[Twisted-web] Cheetah+twisted.web2

Andrea Arcangeli andrea at cpushare.com
Wed Jan 18 14:36:28 MST 2006

On Wed, Jan 18, 2006 at 01:24:26PM -0800, David Reid wrote:
> On Wed, 2006-01-18 at 06:42 +0100, Andrea Arcangeli wrote:
> > On Wed, Jan 18, 2006 at 03:56:41AM +0100, Andrea Arcangeli wrote:
> > > to twisted.web but not to twisted.web2 yet). So I'll do that next.
> > 
> > I did quite an hack to avoid having to update the reverse proxy on the
> > other end (my modified twisted.web reverse proxy):
> > 
> > class myvhost(object):
> I'm not sure why this code was necessary, it looks like a less generic
> version of twisted.web2.vhost.VHostURIRewrite.  

Correct, the only difference (and in turn the only reason I need it) is
the getRemoteHost wrapper class I created in my code. I need the client
IP passed through the proxy. I created an API for that (I sent patches
for twisted.web). So twisted.web+nevow is now talking to twisted.web2,
and this code is allowing twisted.web2 to overwrite the peer ip address.

> > Could somebody suggest the best way to solve the reverse proxy sanely in
> > web2?
> Give me copious amounts of money (or cookies) to whip a client branch
> into shape.

8) I guess the cookies could fit in my current budget ;)

> > Notably we must allow the remote IP to be passed through the proxy (the
> > autorewrite class already contemplated it but it was never implemented).
> Yes it was.  twisted.web2.vhost.VHostAutoURIRewrite, but the proxy needs
> to give us certain headers to get the client IP this is always the case
> (and trust is an issue)

What branch are you looking at? I'm looking trunk and I see:

        # FIXME: remote_ip ?

this is why I said the remote IP forwarding was never implemented. It
receives it, but it does nothing with the received information.

> Create a patch (probably to twisted.web2.log) and submit it to the
> bugtracker, assigned to either foom or dreid. (ideally with unittests)

I already have to use bugtruckers for my job, why can't we just use
email? Thankfully the kernel development doesn't require patches to pass
through bugzilla and Andrew gets them by email. And this is not a bug,
it's a feature... so it should go in the featuretracker if something 8)

I'll have to learn using unittest, I appreciated the email from Andrew
B. on how to create a unittest for the caching feature (the one for
vhost will be simpler).

More information about the Twisted-web mailing list