Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with Python3 - SOCKS #7

Closed
noobiangodd opened this issue Dec 5, 2021 · 2 comments
Closed

Problem with Python3 - SOCKS #7

noobiangodd opened this issue Dec 5, 2021 · 2 comments

Comments

@noobiangodd
Copy link

In a previous issue: #1 (comment), this was fixed for HTTP authentication, however it still occurs on SOCKS

File "C:\Python310\lib\site-packages\pyChainedProxy_init_.py", line 579, in __negotiatesocks5
self.sendall(chr(0x01).encode() +
TypeError: can't concat str to bytes

@makovez
Copy link

makovez commented Dec 31, 2021

You just need to encode everything!
I fixed by replacing lines 580-582 in init.py

# Okay, we need to perform a basic username/password
# authentication.

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)

@seanmcfeely
Copy link

Looks like this repo was forked from PySocksipyChain. They look more responsive but PySocksipyChain had the same issue. I submitted this PR to fix it with the fix described above.

Also I posted a fork of the PySocksipyChain project and published the fork (with the fix appleid) to pypi: https://pypi.org/project/sockschain/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants