Skip to content

Commit

Permalink
Fixes #7
Browse files Browse the repository at this point in the history
  • Loading branch information
nighthawkk authored Apr 20, 2022
1 parent d0da892 commit f6bb733
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pyChainedProxy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,9 +576,14 @@ def __negotiatesocks5(self, destaddr, destport, proxy):
elif chosenauth[1:2] == chr(0x02).encode():
# Okay, we need to perform a basic username/password
# authentication.
self.sendall(chr(0x01).encode() +
if six.PY2:
self.sendall(chr(0x01).encode() +
chr(len(proxy[P_USER])) + proxy[P_USER] +
chr(len(proxy[P_PASS])) + proxy[P_PASS])
else:
self.sendall(chr(0x01).encode() +
chr(len(proxy[P_USER])).encode() + proxy[P_USER].encode() +
chr(len(proxy[P_PASS])).encode() + proxy[P_PASS].encode())
authstat = self.__recvall(2)
if authstat[0:1] != chr(0x01).encode():
# Bad response
Expand Down

0 comments on commit f6bb733

Please sign in to comment.