how to use socks5 proxy in pycurl?

J

Ju Hui

import pycurl
c = pycurl.Curl()
c.setopt( pycurl.URL, 'http://www.test.com/test.html' )
import StringIO
b = StringIO.StringIO()
c.setopt( c.WRITEFUNCTION, b.write )
c.setopt( c.FOLLOWLOCATION, 1 )
c.setopt( c.MAXREDIRS, 5 )
c.setopt(c.PROXY,'www.test.com:1080')
#c.setopt(c.PROXYTYPE,'SOCKS5')
c.setopt(c.PROXYUSERPWD, 'user:pass')
c.perform()
print b.getvalue()


how to use socks5 proxy in pycurl?
 
J

John J. Lee

Ju Hui said:
sorry, I can'y find sample python code there.
I don't know how to set PROXYTYPE..

:(

Note quite sure which post you're replying to since you don't quote
any of it, but if replying to me: URL I posted was for a mailing list
specifically devoted to python and curl. You may want to subscribe to
it and try asking your question there.


John
 

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

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top