WebSocket-for-Python icon indicating copy to clipboard operation
WebSocket-for-Python copied to clipboard

Websocket client: Missing proxy support

Open wklenk opened this issue 8 years ago • 3 comments

The websocket client does not work behind a HTTP proxy. In a company network where all internet access needs to go through a HTTP proxy, the websocket client tries to resolve the IP address of the websocket URL and fails.

Is there any support for HTTP proxies in ws4py ? Are there any solutions for this issue (other websocket libraries that support HTTP proxies) ?

wklenk avatar Aug 01 '17 09:08 wklenk

I have found out just now as well that ws4py does not support proxies. This post is for me a verification of that. (@wklenk)

I foudn that the python package websocket-client does provide proxy support and I verified this using the following code

import websocket

ws = websocket.WebSocket()
ws.connect = ('wss://blabla.com', http_proxy_host='ip', http_proxy_port='8080')

See also here: https://github.com/websocket-client/websocket-client#http-proxy

jberends avatar Aug 11 '17 13:08 jberends

I created a patch with the help of pysocks which supports http/socks5/socks5 proxies: https://gist.github.com/hoozecn/6640b705ba709ee28382a9fee784ff26, wish it helps.

Appreciate if someone could create a pr that will make the ws4py be with native proxy support

hoozecn avatar Oct 01 '17 08:10 hoozecn

This is still a nice to have feature. It will be really helpful.

kushaldas avatar Apr 09 '24 18:04 kushaldas