Browse Source

modified: Encoder/VLESS.py

dev
shevonkuan 2 years ago
parent
commit
a92e291687
  1. 16
      Encoder/VLESS.py

16
Encoder/VLESS.py

@ -15,19 +15,20 @@ def vless(info: dict, name: str) -> str:
link += str(info['port']) + '?' # add <remote-port> link += str(info['port']) + '?' # add <remote-port>
# stream settings # stream settings
streamInfo = info['stream']['type'] streamInfo = info['stream']
stremType = streamInfo['type'] stremType = streamInfo['type']
flow = streamInfo.get('flow', None) flow = streamInfo.get('flow', None)
headerType = streamInfo.get('obfs', 'none') headerType = streamInfo.get('obfs', 'none')
host = streamInfo.get('host', None) host = streamInfo['secure'].get('host', None)
path = streamInfo.get('path', None) path = streamInfo['secure'].get('path', None)
security = streamInfo.get('secure', None) alpn = streamInfo['secure'].get('alpn', None)
alpn = streamInfo.get('alpn', None) sni = streamInfo['secure'].get('sni', None)
sni = streamInfo.get('sni', None) security = streamInfo['secure'].get('type', None)
link += 'type=' + stremType + '&' # add <type> link += 'type=' + stremType + '&' # add <type>
link += 'flow=' + flow + '&' if flow else '' # add <flow> link += 'flow=' + flow + '&' if flow else '' # add <flow>
link += 'headerType=' + headerType + '&' # add <headerType> link += 'headerType=' + headerType + '&' if headerType != None else 'none' # add <headerType>
link += 'security=' + security + '&' if security else '' # add <security> link += 'security=' + security + '&' if security else '' # add <security>
link += 'alpn=' + alpn + '&' if alpn else '' # add <alpn> link += 'alpn=' + alpn + '&' if alpn else '' # add <alpn>
link += 'sni=' + sni + '&' if sni else '' # add <sni> link += 'sni=' + sni + '&' if sni else '' # add <sni>
@ -35,5 +36,4 @@ def vless(info: dict, name: str) -> str:
link += 'path=' + path + '&' if path else '' # add <path> link += 'path=' + path + '&' if path else '' # add <path>
link += '#' + urlEncode(name) # add <descriptive-text> link += '#' + urlEncode(name) # add <descriptive-text>
print(link)
return link return link
Loading…
Cancel
Save