racinette / websockets_proxy

Connect to websockets through a proxy server.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

http proxy over socks5

krava77 opened this issue · comments

Hello!
How can I use http proxies instead of socks5 using websockets_proxy ?
now I get "410 Gone Connection: close"

thank you!

Please, provide a Minimal Reproducible Example (MRE)
You can use socks5 proxies by creating a proxy object with socks5:// set as protocol:

proxy = Proxy.from_url("socks5://user:password@host:port")

Also, your server seems to return a status code, so you should have actually connected, but the server had rejected your connection with the 410 status code (https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/410)

Please, provide a Minimal Reproducible Example (MRE) You can use socks5 proxies by creating a proxy object with socks5:// set as protocol:

proxy = Proxy.from_url("socks5://user:password@host:port")

Also, your server seems to return a status code, so you should have actually connected, but the server had rejected your connection with the 410 status code (https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/410)

Thank you for the fast answer.
here is the link to the project that I try to use. I tried to use python 3.8 and 3.12 but no luck.
https://github.com/ymmmmmmmm/getgrass_bot/blob/main/main.py
here is my proxy server:
'http://******:******@fast.travchisproxies.com:9090',

the proxy server is fully working because I tested it on other services, but they are using only http protocol, not socks5.

Hello again
I've updated ssl and certificates and after that the component stop to work.
here is what I did

pip install --upgrade setuptools
pip install pyOpenSSL cryptography idna certifi --upgrade 
pip install urllib3[secure] --upgrade 
pip install requests[security] --upgrade 

I suppose the issue with the proxy connection, because the proxy does not support ssl or socks5 connection.
could you help how to resolve this issue?

It shouldn't be a problem with SSL certificates: socks5 proxies do not use SSL at all, in fact none of the supported (http, socks4, socks5) protocols do. You really should provide a script, which I can run and debug. Otherwise, I cannot help you. I will not run unknown packages to help you with your programming questions. For me to help you, you'll need to write a MRE script, which:

  1. Defines an async main() function.
  2. Creates a proxy object with a live, functional socks5 proxy.
  3. Connects to the problematic endpoint, sends some messages optionally.
  4. Calls the main function in the if __name__ == '__main__': block.

This way the EXAMPLE is MINIMAL, and REPRODUCES the error. Otherwise, it's a non-issue, because it seems like a server-side problem, not a library-side one.

closing as a non-issue
if you'll be willing to post a MRE, please, do so by creating a new issue