[Twisted-web] Cheetah+twisted.web2

David Reid dreid at dreid.org
Wed Jan 18 14:24:26 MST 2006

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.  

> 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.

> 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)

> class AccessLoggingObserver(log.BaseCommonAccessLoggingObserver):
> 	def __init__(self, logpath):
> 		self.f = file(logpath, 'a')
> 	def logMessage(self, message):
> 		self.f.write(message + '\n')
> 		self.f.flush()

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


More information about the Twisted-web mailing list