File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -72,14 +72,15 @@ async def connect(
7272
7373 # noinspection PyMethodMayBeStatic
7474 async def _read_reply (self , stream : AsyncSocketStream ) -> bytes :
75- data = await stream .read_exact (4 )
75+ data = await stream .read_exact (3 )
7676 if data [0 ] != socks5 .SOCKS_VER :
7777 return data
7878 if data [1 ] != socks5 .ReplyCode .SUCCEEDED :
7979 return data
8080 if data [2 ] != socks5 .RSV :
8181 return data
8282
83+ data += await stream .read_exact (1 )
8384 addr_type = data [3 ]
8485
8586 if addr_type == socks5 .AddressType .IPV4 :
Original file line number Diff line number Diff line change @@ -63,14 +63,15 @@ def connect(
6363
6464 # noinspection PyMethodMayBeStatic
6565 def _read_reply (self , stream : SyncSocketStream ) -> bytes :
66- data = stream .read_exact (4 )
66+ data = stream .read_exact (3 )
6767 if data [0 ] != socks5 .SOCKS_VER :
6868 return data
6969 if data [1 ] != socks5 .ReplyCode .SUCCEEDED :
7070 return data
7171 if data [2 ] != socks5 .RSV :
7272 return data
7373
74+ data += stream .read_exact (1 )
7475 addr_type = data [3 ]
7576
7677 if addr_type == socks5 .AddressType .IPV4 :
You can’t perform that action at this time.
0 commit comments