[Twisted-Python] Proxy support through urllib2?

Gabriel Rossetti gabriel.rossetti at arimaz.com
Tue Jan 19 04:17:41 EST 2010


Kevin Horn wrote:
> On Mon, Jan 11, 2010 at 7:33 AM, Gabriel Rossetti 
> <gabriel.rossetti at arimaz.com <mailto:gabriel.rossetti at arimaz.com>> wrote:
>
>     Hello everyone,
>
>     Is it possible to use a proxy with Twisted? I can do this with
>     urllib2 :
>
>     proxy = urllib2.ProxyHandler({"http": "http://my.proxy.com:8080"})
>     opener = urllib2.build_opener(proxy)
>     urllib2.install_opener(opener)
>
>     will that suffice? I'd need SOCKSv5 and HTTP proxy support.
>
>     Thanks,
>     Gabriel
>
>
> When you say you want to "use a proxy with Twisted", do you mean that 
> you want Your Twisted applicatino to provide a proxy to other 
> applications, or do you mean that you want your Twisted application to 
> use a (separate) proxy?
>
> Kevin Horn
>   
I mean have the Twisted app (client) connect to a server outside the 
network by going through an http proxy server, like it's often the caser 
in company networks.

Gabriel



More information about the Twisted-Python mailing list