How to connect to a proxy?

Use PySocks:
s = socks.socksocket()
proxy = '217.12.202.120:58793'
proxy_ip,proxy_port = proxy.split(':')
s.set_proxy(socks.SOCKS4,proxy_ip,int(proxy_port))
s.connect(("www.sourceforge.net", 80))

what get the following error:

rror: [Errno 9] Bad file descriptor
July 8th 19 at 16:03
1 answer
July 8th 19 at 16:05
and proxy working ?
Yes via browser is checked - tierra_Schill commented on July 8th 19 at 16:08

Find more questions by tags Python