curl-and-python

Re: who can give me a sample code, get a website page via socks5 proxy?

From: juhui <phpbird_at_gmail.com>
Date: Fri, 28 Apr 2006 00:26:12 +0800

thanks a lot! It works!
:)

On 4/26/06, Kjetil Jacobsen <kjetilja_at_gmail.com> wrote:
> hello,
>
> the correct way of specifying that you want to use proxytype socks5 in
> your example would be something like this:
> """
> c.setopt(c.PROXYTYPE, c.PROXYTYPE_SOCKS5)
> """
> - kjetil
>
> On 4/23/06, juhui <phpbird_at_gmail.com> wrote:
> > Hi:
> > I want to get a page with pycurl via socks5 proxy. The code looks like below.
> >
> > 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()
> >
> > but it doesn't work..
> >
> > how to use socks5 proxy in pycurl?
> >
> >
> > thanks.
> >
> > --
> > LB can FlY
> >
> > _______________________________________________
> > http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
> >
>
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
>

--
LB can FlY
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2006-04-27