socket in python with proxies

Astan Chee stanc at al.com.au
Thu Dec 20 23:38:03 EST 2007


Hi, I have a proxy server that requires authentication on a non-standard 
port and Im trying to connect to it via socket.connect()
I tried doing this:
import socket
server = ("username:password at proxyaddrs.com",1234)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(server)

I keep getting the

Traceback (most recent call last):
  File "<pyshell#6>", line 1, in <module>
    s.connect(server)
  File "<string>", line 1, in connect
gaierror: (11001, 'getaddrinfo failed')

What does this mean? and can I actually use username/password to connect 
using a socket in python?
Thanks
Astan



More information about the Python-list mailing list