From 0283d6264a94a99950251abe5548345cf35bae44 Mon Sep 17 00:00:00 2001 From: Erfan <37825504+erfantkerfan@users.noreply.github.com> Date: Sun, 9 Aug 2020 13:21:43 +0430 Subject: [PATCH] set the home domain instead of IP (#231) * set the home domain set the home domain for the proxy, has an influence only on the log message * fixed a bug --- mtprotoproxy.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/mtprotoproxy.py b/mtprotoproxy.py index eaeacf6..a26bf72 100755 --- a/mtprotoproxy.py +++ b/mtprotoproxy.py @@ -195,6 +195,9 @@ def init_config(): # the next host to forward bad clients conf_dict.setdefault("MASK_HOST", conf_dict["TLS_DOMAIN"]) + + # set the home domain for the proxy, has an influence only on the log message + conf_dict.setdefault("MY_DOMAIN", False) # the next host's port to forward bad clients conf_dict.setdefault("MASK_PORT", 443) @@ -2104,9 +2107,12 @@ def print_tg_info(): print("Since you have TLS only mode enabled the best port is 443", flush=True) print_default_warning = True - ip_addrs = [ip for ip in my_ip_info.values() if ip] - if not ip_addrs: - ip_addrs = ["YOUR_IP"] + if not config.MY_DOMAIN: + ip_addrs = [ip for ip in my_ip_info.values() if ip] + if not ip_addrs: + ip_addrs = ["YOUR_IP"] + else: + ip_addrs = [config.MY_DOMAIN] proxy_links = []