can httplib.HTTPConnection use proxy?

R

robert

JuHui said:
how to use httplib.HTTPConnection with http proxy?

simply connect to the proxy? - and ask using the full url and original
Host: - for HTTPS do a CONNECT <host>.

Robert
 
J

JuHui

sorry, would you please give a sample code?
I want to use HTTPConnection to get a html page content via a http
proxy.
thanks.
 
A

adam

import httplibTraceback (most recent call last):
File "<interactive input>", line 1, in ?
File "C:\Python24\lib\httplib.py", line 627, in connect
raise socket.error, msg
error: (10061, 'Connection refused')
 
R

robert

JuHui said:
sorry, would you please give a sample code?
I want to use HTTPConnection to get a html page content via a http
proxy.
thanks.

-> adam

and maybe you just want plain GET/POST. use urllib
).read()
'<html><head><meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1"><title>Google</title><style><!--\nbody,td,a,p,.h{font-family:arial,sans-serif;}\n.h{font-size:
20px....



Robert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top