fix server
This commit is contained in:
parent
f49d086d6a
commit
fd35f1d067
3 changed files with 5 additions and 3 deletions
|
@ -52,10 +52,10 @@ def main():
|
|||
udp_servers = []
|
||||
for port, password in config['port_password'].items():
|
||||
a_config = config.copy()
|
||||
a_config['server_port'] = port
|
||||
a_config['server_port'] = int(port)
|
||||
a_config['password'] = password
|
||||
logging.info("starting server at %s:%d" %
|
||||
(a_config['server'], port))
|
||||
(a_config['server'], int(port)))
|
||||
tcp_server = tcprelay.TCPRelay(config, False)
|
||||
tcp_servers.append(tcp_server)
|
||||
udp_server = udprelay.UDPRelay(config, False)
|
||||
|
|
|
@ -248,6 +248,8 @@ class TCPRelayHandler(object):
|
|||
return
|
||||
if self._is_local:
|
||||
data = self._encryptor.decrypt(data)
|
||||
else:
|
||||
data = self._encryptor.encrypt(data)
|
||||
try:
|
||||
self.write_all_to_sock(data, self._local_sock)
|
||||
except Exception:
|
||||
|
|
|
@ -77,7 +77,7 @@ def get_config(is_local):
|
|||
shortopts = 's:b:p:k:l:m:c:t:v'
|
||||
longopts = ['fast-open']
|
||||
else:
|
||||
shortopts = 's:p:k:m:c:t:'
|
||||
shortopts = 's:p:k:m:c:t:v'
|
||||
longopts = ['fast-open', 'workers:']
|
||||
try:
|
||||
config_path = find_config()
|
||||
|
|
Loading…
Reference in a new issue