Skip to content

Commit

Permalink
change the tls links to hex encoding until base64 is fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbers committed Aug 13, 2019
1 parent 5318447 commit ab52521
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions mtprotoproxy.py
Expand Up @@ -1478,9 +1478,11 @@ def print_tg_info():
params_encodeded = urllib.parse.urlencode(params, safe=':')
print("{}: tg://proxy?{}".format(user, params_encodeded), flush=True)

tls_secret = bytes.fromhex("ee" + secret) + config.TLS_DOMAIN.encode()
tls_secret_base64 = base64.urlsafe_b64encode(tls_secret)
params = {"server": ip, "port": config.PORT, "secret": tls_secret_base64}
tls_secret = "ee" + secret + config.TLS_DOMAIN.encode().hex()
# the base64 links is buggy on ios
# tls_secret = bytes.fromhex("ee" + secret) + config.TLS_DOMAIN.encode()
# tls_secret_base64 = base64.urlsafe_b64encode(tls_secret)
params = {"server": ip, "port": config.PORT, "secret": tls_secret}
params_encodeded = urllib.parse.urlencode(params, safe=':')
print("{}: tg://proxy?{} (experimental)".format(user, params_encodeded), flush=True)

Expand Down

0 comments on commit ab52521

Please sign in to comment.