diff --git a/shadowsocks/common.py b/shadowsocks/common.py index 7f306ea..d100d71 100644 --- a/shadowsocks/common.py +++ b/shadowsocks/common.py @@ -294,12 +294,12 @@ def test_inet_conv(): def test_parse_header(): assert parse_header(b'\x03\x0ewww.google.com\x00\x50') == \ - (3, b'www.google.com', 80, 18) + (0, b'www.google.com', 80, 18) assert parse_header(b'\x01\x08\x08\x08\x08\x00\x35') == \ - (1, b'8.8.8.8', 53, 7) + (0, b'8.8.8.8', 53, 7) assert parse_header((b'\x04$\x04h\x00@\x05\x08\x05\x00\x00\x00\x00\x00' b'\x00\x10\x11\x00\x50')) == \ - (4, b'2404:6800:4005:805::1011', 80, 19) + (0, b'2404:6800:4005:805::1011', 80, 19) def test_pack_header(): diff --git a/shadowsocks/encrypt_test.py b/shadowsocks/encrypt_test.py index 68228e1..0121d63 100644 --- a/shadowsocks/encrypt_test.py +++ b/shadowsocks/encrypt_test.py @@ -7,10 +7,10 @@ import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../')) -from crypto import rc4_md5 -from crypto import openssl -from crypto import sodium -from crypto import table +from shadowsocks.crypto import rc4_md5 +from shadowsocks.crypto import openssl +from shadowsocks.crypto import sodium +from shadowsocks.crypto import table def main(): print("\n""rc4_md5") diff --git a/shadowsocks/manager.py b/shadowsocks/manager.py index bfabd7f..9009253 100644 --- a/shadowsocks/manager.py +++ b/shadowsocks/manager.py @@ -207,7 +207,9 @@ def test(): eventloop.TIMEOUT_PRECISION = 1 def run_server(): - config = { + config = shell.get_config(True) + config = config.copy() + a_config = { 'server': '127.0.0.1', 'local_port': 1081, 'port_password': { @@ -220,7 +222,8 @@ def test(): 'fast_open': False, 'verbose': 2 } - manager = Manager(config) + a_config.update(config) + manager = Manager(a_config) enc.append(manager) manager.run()