Skip to content

Commit

Permalink
Merge branch 'erfjab-address-list' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
SaintShit committed Jul 29, 2024
2 parents d6607dd + 0cc9cb2 commit ec63f3b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion app/subscription/share.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ def process_inbounds_and_tags(
format_variables.update({"TRANSPORT": inbound["network"]})
host_inbound = inbound.copy()
for host in xray.hosts.get(tag, []):

sni = ""
sni_list = host["sni"] or inbound["sni"]
if sni_list:
Expand All @@ -278,9 +279,13 @@ def process_inbounds_and_tags(
if req_host_list:
salt = secrets.token_hex(8)
req_host = random.choice(req_host_list).replace("*", salt)

address = ""
address_list = host['address']
if host['address']:
salt = secrets.token_hex(8)
address = host['address'].replace('*', salt)
address = random.choice(address_list).replace('*', salt)

if host["path"] is not None:
path = host["path"].format_map(format_variables)
else:
Expand Down
2 changes: 1 addition & 1 deletion app/xray/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def hosts(storage: dict):
storage[inbound_tag] = [
{
"remark": host.remark,
"address": host.address,
"address": [i.strip() for i in host.address.split(',')] if host.address else [],
"port": host.port,
"path": host.path if host.path else None,
"sni": [i.strip() for i in host.sni.split(',')] if host.sni else [],
Expand Down

0 comments on commit ec63f3b

Please sign in to comment.