Browse Source

fix multiple servers

auth
clowwindy 11 years ago
parent
commit
7a1647278f
  1. 6
      shadowsocks/server.py
  2. 5
      test/server-multi-passwd.json

6
shadowsocks/server.py

@ -56,9 +56,9 @@ def main():
a_config['password'] = password a_config['password'] = password
logging.info("starting server at %s:%d" % logging.info("starting server at %s:%d" %
(a_config['server'], int(port))) (a_config['server'], int(port)))
tcp_server = tcprelay.TCPRelay(config, False) tcp_server = tcprelay.TCPRelay(a_config, False)
tcp_servers.append(tcp_server) tcp_servers.append(tcp_server)
udp_server = udprelay.UDPRelay(config, False) udp_server = udprelay.UDPRelay(a_config, False)
udp_servers.append(udp_server) udp_servers.append(udp_server)
def run_server(): def run_server():
@ -96,7 +96,7 @@ def main():
# master # master
for tcp_server in tcp_servers: for tcp_server in tcp_servers:
tcp_server.server_close() tcp_server.close()
for udp_server in udp_servers: for udp_server in udp_servers:
udp_server.close() udp_server.close()

5
test/server-multi-passwd.json

@ -12,10 +12,7 @@
"8386": "foobar6", "8386": "foobar6",
"8387": "foobar7", "8387": "foobar7",
"8388": "foobar8", "8388": "foobar8",
"8389": "foobar9", "8389": "foobar9"
"8390": "foobar10",
"8391": "foobar11",
"8392": "foobar12"
}, },
"timeout": 60, "timeout": 60,
"method": "aes-256-cfb" "method": "aes-256-cfb"

Loading…
Cancel
Save