update config to _config for tunnel
and fix pep8
This commit is contained in:
parent
ac1883eb7f
commit
bfb5e93843
2 changed files with 10 additions and 8 deletions
|
@ -53,11 +53,12 @@ def main():
|
||||||
has_tunnel = False
|
has_tunnel = False
|
||||||
# if both_tunnel_local is True then run tunnel_udp_server
|
# if both_tunnel_local is True then run tunnel_udp_server
|
||||||
if config["both_tunnel_local"]:
|
if config["both_tunnel_local"]:
|
||||||
config["local_port"] = config.copy()["tunnel_port"]
|
_config = config.copy()
|
||||||
|
_config["local_port"] = _config["tunnel_port"]
|
||||||
logging.info("starting tunnel at %s:%d forward to %s:%d" %
|
logging.info("starting tunnel at %s:%d forward to %s:%d" %
|
||||||
(config['local_address'], config['local_port'], config['tunnel_remote'],
|
(_config['local_address'], _config['local_port'],
|
||||||
config['tunnel_remote_port']))
|
_config['tunnel_remote'], _config['tunnel_remote_port']))
|
||||||
tunnel_udp_server = udprelay.UDPRelay(config, dns_resolver, True)
|
tunnel_udp_server = udprelay.UDPRelay(_config, dns_resolver, True)
|
||||||
tunnel_udp_server.is_tunnel = True
|
tunnel_udp_server.is_tunnel = True
|
||||||
tunnel_udp_server.add_to_loop(loop)
|
tunnel_udp_server.add_to_loop(loop)
|
||||||
has_tunnel = True
|
has_tunnel = True
|
||||||
|
|
|
@ -43,11 +43,12 @@ def main():
|
||||||
loop = eventloop.EventLoop()
|
loop = eventloop.EventLoop()
|
||||||
dns_resolver.add_to_loop(loop)
|
dns_resolver.add_to_loop(loop)
|
||||||
# tcp_server.add_to_loop(loop)
|
# tcp_server.add_to_loop(loop)
|
||||||
config["local_port"] = config.copy()["tunnel_port"]
|
_config = config.copy()
|
||||||
|
_config["local_port"] = _config["tunnel_port"]
|
||||||
logging.info("starting tunnel at %s:%d forward to %s:%d" %
|
logging.info("starting tunnel at %s:%d forward to %s:%d" %
|
||||||
(config['local_address'], config['local_port'], config['tunnel_remote'],
|
(_config['local_address'], _config['local_port'],
|
||||||
config['tunnel_remote_port']))
|
_config['tunnel_remote'], _config['tunnel_remote_port']))
|
||||||
tunnel_udp_server = udprelay.UDPRelay(config, dns_resolver, True)
|
tunnel_udp_server = udprelay.UDPRelay(_config, dns_resolver, True)
|
||||||
tunnel_udp_server.is_tunnel = True
|
tunnel_udp_server.is_tunnel = True
|
||||||
tunnel_udp_server.add_to_loop(loop)
|
tunnel_udp_server.add_to_loop(loop)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue