[Twisted-web] Fwd: Web-Based Proxy
dave fowler
davefowler at gmail.com
Tue Jul 21 18:46:54 EDT 2009
Perfect! Thanks a ton! That was just the lead I needed. Did some more
digging around and now I've got it running great. Next I just have to
figure out SSL support :).
Thanks again!
Dave
On Tue, Jul 21, 2009 at 12:19 PM, Jean-Paul Calderone <exarkun at divmod.com>wrote:
> On Tue, 21 Jul 2009 11:44:43 -0500, dave fowler <davefowler at gmail.com>
> wrote:
> >Thanks for your help Jean-Paul.
> >
> >In my example I've just subclassed the protocol and factory so I could
> print
> >out the properties and have a little control over things as I learn. The
> >proxy could of course be much easily run as
> >
> > from twisted.web import http
> > f = http.HTTPFactory()
> > f.protocol = Proxy
> >
> >I should be a bit more specific about what I'm currently confused about.
> >
> >*I'm trying to find where I can grab the request URI from the client so I
> >can modify it from www.asdf.com.MYPROXYSITE.com to www.asdf.com before
> the
> >proxy client makes its requests. Where can you access and modify those
> >parameters?*
> >
>
> Proxy uses twisted.web.proxy.ProxyRequest as its request factory. The
> request will have its "process" method called when it has been completely
> received. You can subclass ProxyRequest, set your proxy to use that
> subclass
> as its request factory, and in that subclass, override process to change
> the
> uri before calling the base implementation. How's that?
>
> Jean-Paul
>
> _______________________________________________
> Twisted-web mailing list
> Twisted-web at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-web/attachments/20090721/54264648/attachment.htm
More information about the Twisted-web
mailing list