[Twisted-Python] Ramblings about creating URLs in Twisted Web

Itamar Shtull-Trauring itamar at itamarst.org
Sat Jun 28 18:18:19 EDT 2003


On Sat, 28 Jun 2003 11:49:42 -0700
Donovan Preston <dp at twistedmatrix.com> wrote:

> Just thought I'd let people know I posted a fairly long piece about
> the problems inherent with creating URLs in Twisted Web, and a hopeful
> 
> solution:

One way to do reverse proxying that works correctly is to use what Zope
calls VirtualHostMonster - you pass the real domain and path as part of
a rewritten Zope server and it extracts them and mangles the reqyest
correctly.

Twisted currently supports this for domains (though not paths, the code
needs to be extended) using some code which is in twisted.web.vhost
IIRC. twisted-web does this out of the box, so you can do:

<VirtualHost 1.2.3.4>
ServerName www.example.com
ProxyPass / http://localhost:8234/vhost/http/www.example.com:80/
</VirtualHost>

in apache, which will forward requests to the twisted-web server and
DTRT regarding the request generated URLs.

-- 
Itamar Shtull-Trauring    http://itamarst.org/
http://www.zoteca.com -- Python & Twisted consulting




More information about the Twisted-Python mailing list