Skip to content

Commit

Permalink
add ipv6 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
clowwindy committed Nov 10, 2014
1 parent e476a54 commit fa31a23
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 3 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ script:
- python tests/test.py -c tests/server-multi-ports.json
- python tests/test.py -s tests/server-multi-passwd.json -c tests/server-multi-passwd-client-side.json
- python tests/test.py -c tests/workers.json
- python tests/test.py -s tests/ipv6.json -c tests/ipv6-client-side.json
- python tests/test.py -b "-m rc4-md5 -k testrc4 -s 127.0.0.1 -p 8388" -a "-m rc4-md5 -k testrc4 -s 127.0.0.1 -p 8388 -l 1081"
- python tests/test.py -b "-m aes-256-cfb -k testrc4 -s 127.0.0.1 -p 8388" -a "-m aes-256-cfb -k testrc4 -s 127.0.0.1 -p 8388 -l 1081"
2 changes: 1 addition & 1 deletion shadowsocks/tcprelay.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def _handle_stage_hello(self, data):
header = b'\x05\x00\x00\x04'
else:
header = b'\x05\x00\x00\x01'
addr, port = self._local_sock.getsockname()
addr, port = self._local_sock.getsockname()[:2]
addr_to_send = socket.inet_pton(self._local_sock.family,
addr)
port_to_send = struct.pack('>H', port)
Expand Down
10 changes: 10 additions & 0 deletions tests/ipv6-client-side.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"server":"::1",
"server_port":8388,
"local_port":1081,
"password":"aes_password",
"timeout":60,
"method":"aes-256-cfb",
"local_address":"127.0.0.1",
"fast_open":false
}
10 changes: 10 additions & 0 deletions tests/ipv6.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"server":"::",
"server_port":8388,
"local_port":1081,
"password":"aes_password",
"timeout":60,
"method":"aes-256-cfb",
"local_address":"127.0.0.1",
"fast_open":false
}
4 changes: 2 additions & 2 deletions tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@

config = parser.parse_args()

client_args = [python, 'shadowsocks/local.py']
server_args = [python, 'shadowsocks/server.py']
client_args = [python, 'shadowsocks/local.py', '-v']
server_args = [python, 'shadowsocks/server.py', '-v']

if config.client_conf:
client_args.extend(['-c', config.client_conf])
Expand Down

0 comments on commit fa31a23

Please sign in to comment.