[Twisted-web] Nevow and distrib

David Reid dreid at dreid.org
Sun Jul 11 23:21:11 MDT 2004

Much more interesting, is the new-web/twisted/web/proxy.py which moshez
rewrote to allow support of both TCP and Unix sockets.
In a much cleaner way than my distrib.py hackery.


On Sun, 2004-07-11 at 20:01, Matt Goodall wrote:
> Hi all,
> Attached is a distrib module and a patch to nevow/appserver.py that
> allows Nevow to work behind a distrib server. Yippee! I claim no credit
> for the distrib module, I ripped it from new-web. The change to
> appserver.py is almost certainly not robust enough but ti works for a
> simple distrib server. Patches will be most welcome as you fix the
> bugs ;-).
> You don't need a Publisher with this as it's all proxy based. I imagine
> the proxy will work over a UNIX socket but I only tested over TCP. Below
> is the server I used to test:
> from twisted.application import service
> from twisted.application import internet
> from nevow import appserver, distrib
> application = service.Application('distribtest')
> internet.TCPServer(
>     8000,
>     appserver.NevowSite(
>         distrib.ResourceSubscription('localhost', 8001)
>     )
> ).setServiceParent(application)
> Also, I imagine it's relatively easy to use the same technique to hide a
> Nevow app behind Apache. It's just a matter of adding a 'x-forwarded-
> from' header to the request before proxying it to the twistd server (see
> distrib.py). mod_proxy + mod_headers should help, maybe mod_rewrite too.
> Hope this is of interest.
> Cheers, Matt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://pyramid.twistedmatrix.com/pipermail/twisted-web/attachments/20040711/b4b280d5/attachment.bin

More information about the Twisted-web mailing list