Думаю вы о HTTP
proxy. Вот обсуждение
Hi,
thank you all for your help. I tried
urllib, httplib and sockets.
With urllib:
f =
urllib.urlopen("http://www.python.org/index.html")
I get:
.... invalid proxy for http:
'cache.ilt.fhg.de:81'
httplib works:
conn = httplib.HTTPConnection("cache.ilt.fhg.de", 81)
conn.request("GET", "http://www.python.org/index.html")
r = conn.getresponse()
print r.status, r.reason
print r.msg
while 1:
data = r.read(1024)
if len(data) < 1024: break
print data
and so do sockets:
HOST = 'cache.ilt.fhg.de'
PORT = 81
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
s.send('GET http://www.python.org/index.html HTTP/1.1\r\nAccept:
text/plain\r\n\r\n')
while 1:
data = s.recv(1024)
print data
if len(data) < 1024: break
s.close()
Thanks again
Rolf Wester.