From a92e291687151416601723050abf22fc41c1970b Mon Sep 17 00:00:00 2001 From: shevonkuan Date: Tue, 3 Jan 2023 17:12:46 +0800 Subject: [PATCH] modified: Encoder/VLESS.py --- Encoder/VLESS.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Encoder/VLESS.py b/Encoder/VLESS.py index 850246c..69f0207 100644 --- a/Encoder/VLESS.py +++ b/Encoder/VLESS.py @@ -15,19 +15,20 @@ def vless(info: dict, name: str) -> str: link += str(info['port']) + '?' # add # stream settings - streamInfo = info['stream']['type'] + streamInfo = info['stream'] + stremType = streamInfo['type'] flow = streamInfo.get('flow', None) headerType = streamInfo.get('obfs', 'none') - host = streamInfo.get('host', None) - path = streamInfo.get('path', None) - security = streamInfo.get('secure', None) - alpn = streamInfo.get('alpn', None) - sni = streamInfo.get('sni', None) + host = streamInfo['secure'].get('host', None) + path = streamInfo['secure'].get('path', None) + alpn = streamInfo['secure'].get('alpn', None) + sni = streamInfo['secure'].get('sni', None) + security = streamInfo['secure'].get('type', None) link += 'type=' + stremType + '&' # add link += 'flow=' + flow + '&' if flow else '' # add - link += 'headerType=' + headerType + '&' # add + link += 'headerType=' + headerType + '&' if headerType != None else 'none' # add link += 'security=' + security + '&' if security else '' # add link += 'alpn=' + alpn + '&' if alpn else '' # add link += 'sni=' + sni + '&' if sni else '' # add @@ -35,5 +36,4 @@ def vless(info: dict, name: str) -> str: link += 'path=' + path + '&' if path else '' # add link += '#' + urlEncode(name) # add - print(link) return link \ No newline at end of file