Browse Source

using '#' to split multi-user setting

dev
破娃酱 8 years ago
parent
commit
b367ad0560
  1. 2
      shadowsocks/obfsplugin/auth.py
  2. 4
      shadowsocks/tcprelay.py
  3. 4
      shadowsocks/udprelay.py

2
shadowsocks/obfsplugin/auth.py

@ -1131,7 +1131,7 @@ class auth_aes128_sha1(auth_base):
def set_server_info(self, server_info): def set_server_info(self, server_info):
self.server_info = server_info self.server_info = server_info
try: try:
max_client = int(server_info.protocol_param) max_client = int(server_info.protocol_param.split('#')[0])
except: except:
max_client = 64 max_client = 64
self.server_info.data.set_max_client(max_client) self.server_info.data.set_max_client(max_client)

4
shadowsocks/tcprelay.py

@ -1020,7 +1020,9 @@ class TCPRelay(object):
self._listen_port = listen_port self._listen_port = listen_port
if config['protocol'] in ["auth_aes128_md5", "auth_aes128_sha1"]: if config['protocol'] in ["auth_aes128_md5", "auth_aes128_sha1"]:
user_list = config['protocol_param'].split(',') param = config['protocol_param'].split('#')
if len(param) == 2:
user_list = param[1].split(',')
if user_list: if user_list:
for user in user_list: for user in user_list:
items = user.split(':') items = user.split(':')

4
shadowsocks/udprelay.py

@ -902,7 +902,9 @@ class UDPRelay(object):
self.server_user_transfer_dl = {} self.server_user_transfer_dl = {}
if config['protocol'] in ["auth_aes128_md5", "auth_aes128_sha1"]: if config['protocol'] in ["auth_aes128_md5", "auth_aes128_sha1"]:
user_list = config['protocol_param'].split(',') param = config['protocol_param'].split('#')
if len(param) == 2:
user_list = param[1].split(',')
if user_list: if user_list:
for user in user_list: for user in user_list:
items = user.split(':') items = user.split(':')

Loading…
Cancel
Save