add some endlines

This commit is contained in:
Alexander Bersenev
2018-11-27 22:25:47 +05:00
parent e2435461ca
commit bd8e0f935d

View File

@@ -14,10 +14,10 @@ import re
import runpy import runpy
import signal import signal
if len(sys.argv) < 2: if len(sys.argv) < 2:
config = runpy.run_module("config") config = runpy.run_module("config")
elif len(sys.argv) == 2: elif len(sys.argv) == 2:
# launch with own config
config = runpy.run_path(sys.argv[1]) config = runpy.run_path(sys.argv[1])
else: else:
# undocumented way of launching # undocumented way of launching
@@ -33,30 +33,43 @@ USERS = config["USERS"]
AD_TAG = bytes.fromhex(config.get("AD_TAG", "")) AD_TAG = bytes.fromhex(config.get("AD_TAG", ""))
# load advanced settings # load advanced settings
# if IPv6 avaliable, use it by default # if IPv6 avaliable, use it by default
PREFER_IPV6 = config.get("PREFER_IPV6", socket.has_ipv6) PREFER_IPV6 = config.get("PREFER_IPV6", socket.has_ipv6)
# disables tg->client trafic reencryption, faster but less secure # disables tg->client trafic reencryption, faster but less secure
FAST_MODE = config.get("FAST_MODE", True) FAST_MODE = config.get("FAST_MODE", True)
# doesn't allow to connect in not-secure mode # doesn't allow to connect in not-secure mode
SECURE_ONLY = config.get("SECURE_ONLY", False) SECURE_ONLY = config.get("SECURE_ONLY", False)
# delay in seconds between stats printing # delay in seconds between stats printing
STATS_PRINT_PERIOD = config.get("STATS_PRINT_PERIOD", 600) STATS_PRINT_PERIOD = config.get("STATS_PRINT_PERIOD", 600)
# delay in seconds between middle proxy info updates # delay in seconds between middle proxy info updates
PROXY_INFO_UPDATE_PERIOD = config.get("PROXY_INFO_UPDATE_PERIOD", 24*60*60) PROXY_INFO_UPDATE_PERIOD = config.get("PROXY_INFO_UPDATE_PERIOD", 24*60*60)
# max socket buffer size to the client direction, the more the faster, but more RAM hungry # max socket buffer size to the client direction, the more the faster, but more RAM hungry
TO_CLT_BUFSIZE = config.get("TO_CLT_BUFSIZE", 16384) TO_CLT_BUFSIZE = config.get("TO_CLT_BUFSIZE", 16384)
# max socket buffer size to the telegram servers direction # max socket buffer size to the telegram servers direction
TO_TG_BUFSIZE = config.get("TO_TG_BUFSIZE", 65536) TO_TG_BUFSIZE = config.get("TO_TG_BUFSIZE", 65536)
# keepalive period for clients in secs # keepalive period for clients in secs
CLIENT_KEEPALIVE = config.get("CLIENT_KEEPALIVE", 10*60) CLIENT_KEEPALIVE = config.get("CLIENT_KEEPALIVE", 10*60)
# drop client after this timeout if the handshake fail # drop client after this timeout if the handshake fail
CLIENT_HANDSHAKE_TIMEOUT = config.get("CLIENT_HANDSHAKE_TIMEOUT", 10) CLIENT_HANDSHAKE_TIMEOUT = config.get("CLIENT_HANDSHAKE_TIMEOUT", 10)
# if client doesn't confirm data for this number of seconds, it is dropped # if client doesn't confirm data for this number of seconds, it is dropped
CLIENT_ACK_TIMEOUT = config.get("CLIENT_ACK_TIMEOUT", 5*60) CLIENT_ACK_TIMEOUT = config.get("CLIENT_ACK_TIMEOUT", 5*60)
# telegram servers connect timeout in seconds # telegram servers connect timeout in seconds
TG_CONNECT_TIMEOUT = config.get("TG_CONNECT_TIMEOUT", 10) TG_CONNECT_TIMEOUT = config.get("TG_CONNECT_TIMEOUT", 10)
# listen address for IPv4 # listen address for IPv4
LISTEN_ADDR_IPV4 = config.get("LISTEN_ADDR_IPV4", "0.0.0.0") LISTEN_ADDR_IPV4 = config.get("LISTEN_ADDR_IPV4", "0.0.0.0")
# listen address for IPv6 # listen address for IPv6
LISTEN_ADDR_IPV6 = config.get("LISTEN_ADDR_IPV6", "::") LISTEN_ADDR_IPV6 = config.get("LISTEN_ADDR_IPV6", "::")