[Twisted-web] Twisted to proxy php out to apache?

David Reid dreid at dreid.org
Wed May 24 12:08:22 CDT 2006

Hash: SHA1

Remi C Cool wrote:
> Hello fellow twisters,

Hello again.

> I know about the reverseproxy stuff .. but if I understand that
> correctly, it's about passing requests to twisted from apache or other
> server. I would like it to be the other way round .. twisted passes
> requests for PHP to apache, receives the processed content and passes
> that back to the client. (if that method doesn't have any significant
> drawbacks)

class ReverseProxyResource(resource.Resource):
    """Resource that renders the results gotten from another server

    Put this resource in the tree to cause everything below it to be relayed
    to a different server.

I'm sorry, you don't understand it correctly.  mod_proxy which passes
requests from apache to another server such as twisted is a reverse
proxy, ReverseProxyResource is an implementation of a reverse proxy for
twisted so that it can forward requests to another server.  It takes a
host, a port, and a path and it proxies all requests for that resource
to the server specified by the host, port, and path.

for example, ReverseProxyResource('google.com', 80, '/') will forward
requests to http://google.com:80/.

- -David

- --
"Usually the protocol is this: I appoint someone for a task,
which they are not qualified to do.  Then, they have to fight
a bear if they don't want to do it." -- Glyph Lefkowitz
Version: GnuPG v1.4.2.2 (Darwin)


More information about the Twisted-web mailing list