[Twisted-web] Internal link shows port behind the server by ReverseProxyResource.

Taito Horiuchi dev at abita.fi
Sun Nov 30 09:02:01 EST 2008


Hi,

I'm new to Twisted, but would like to try to use it as a web front server.
I try to use ReverseProxyResource to provide internal server with port 20001
to port 80.
The code below successfully provides the content of http://localhost:20001/=
as
http://localhost/,
but the internal link within the page shows port 20001.
How can I fix this?

Taito

The code:

from twisted.internet import reactor
from twisted.web import server, proxy, vhost

PORT =3D 20001
HostName =3D 'localhost'
reverseProxy =3D proxy.ReverseProxyResource(HostName, PORT, '')


root =3D vhost.NameVirtualHost()
root.addHost(HostName, reverseProxy)
site =3D server.Site(root)
reactor.listenTCP(80, site)
reactor.run()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-web/attachments/20081130/a5=
75fada/attachment.htm


More information about the Twisted-web mailing list