Module Expr Str ImportFrom alias alias ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias alias ClassDef bases NameLoad body Expr Str Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad If CompareIn Str NameLoad body Delete SubscriptDel NameLoad Index Str Assign SubscriptStore NameLoad Index Str Str Expr Call AttributeLoad NameLoad attr Str NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body If CompareIn Call AttributeLoad NameLoad attr ListLoad Str Str Str body Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad ListLoad NameLoad orelse Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If UnaryOpNot AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Num Str Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Dict Str NameLoad Assign NameStore Dict Str Num FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore Call AttributeLoad SubscriptLoad NameLoad Index Num attr Str Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad If CompareIn Str NameLoad body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd TupleLoad Str Str SubscriptLoad NameLoad Slice Num If UnaryOpNot NameLoad body Assign NameStore BinOpAdd NameLoad Str Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr attr If CompareNotIn Str NameLoad body Assign SubscriptStore NameLoad Index Str Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Num Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore NameLoad decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str ListLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore NameLoad decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Return Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr BinOpAdd BinOpAdd AttributeLoad NameLoad attr Str Call AttributeLoad Call NameLoad NameLoad keyword Str attr Str AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareEq AttributeLoad NameLoad attr Num body Assign NameStore AttributeLoad NameLoad attr orelse Assign NameStore BinOpAdd BinOpAdd AttributeLoad NameLoad attr Str Call NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str ListLoad Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Num Num Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Index Num If NameLoad body Assign NameStore BinOpAdd BinOpAdd AttributeLoad NameLoad attr Str NameLoad orelse Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list decorator_list
N/A N/A 
Simplistic HTTP proxy support.

This comes in two main variants - the Proxy and the ReverseProxy.

When a Proxy is in use, a browser trying to connect to a server (say,
www.yahoo.com) will be intercepted by the Proxy, and the proxy will covertly
connect to the server, and return the result.

When a ReverseProxy is in use, the client connects directly to the ReverseProxy
(say, www.yahoo.com) which farms off the request to one of a pool of servers,
and returns the result.

Normally, a Proxy is used on the client end of an Internet connection, while a
ReverseProxy is used on the server end.
 __future__ absolute_import division twisted.python.compat urllib_parse urlquote twisted.internet reactor twisted.internet.protocol ClientFactory twisted.web.resource Resource twisted.web.server NOT_DONE_YET twisted.web.http HTTPClient Request HTTPChannel ProxyClient N/A HTTPClient N/A N/A 
    Used by ProxyClientFactory to implement a simple web proxy.

    @ivar _finished: A flag which indicates whether or not the original request
        has been finished yet.
     N/A _finished False __init__ N/A N/A self command rest version headers data father N/A N/A N/A N/A self father father N/A N/A self command command N/A N/A self rest rest N/A N/A proxy-connection headers N/A N/A N/A headers N/A proxy-connection N/A N/A headers N/A connection close N/A N/A N/A headers pop keep-alive None N/A N/A self headers headers N/A N/A self data data N/A connectionMade N/A N/A self N/A N/A N/A N/A N/A self sendCommand N/A self command N/A self rest N/A N/A header value N/A N/A N/A self headers items N/A N/A N/A N/A self sendHeader header value N/A N/A N/A self endHeaders N/A N/A N/A N/A self transport write N/A self data N/A handleStatus N/A N/A self version code message N/A N/A N/A N/A N/A N/A self father setResponseCode N/A int code message N/A handleHeader N/A N/A self key value N/A N/A N/A N/A N/A N/A key lower N/A server date content-type N/A N/A N/A N/A N/A N/A self father responseHeaders setRawHeaders key N/A value N/A N/A N/A N/A N/A N/A self father responseHeaders addRawHeader key value N/A handleResponsePart N/A N/A self buffer N/A N/A N/A N/A N/A N/A self father write buffer N/A handleResponseEnd N/A N/A self N/A N/A N/A 
        Finish the original request, indicating that the response has been
        completely written to it, and disconnect the outgoing transport.
         N/A N/A N/A self _finished N/A N/A N/A self _finished True N/A N/A N/A N/A self father finish N/A N/A N/A N/A self transport loseConnection N/A N/A ProxyClientFactory N/A ClientFactory N/A N/A 
    Used by ProxyRequest to implement a simple web proxy.
     N/A protocol ProxyClient __init__ N/A N/A self command rest version headers data father N/A N/A N/A N/A self father father N/A N/A self command command N/A N/A self rest rest N/A N/A self headers headers N/A N/A self data data N/A N/A self version version N/A buildProtocol N/A N/A self addr N/A N/A N/A N/A N/A self protocol N/A self command N/A self rest N/A self version N/A self headers N/A self data N/A self father N/A clientConnectionFailed N/A N/A self connector reason N/A N/A N/A 
        Report a connection failure in a response to the incoming request as
        an error.
         N/A N/A N/A N/A self father setResponseCode 501 Gateway error N/A N/A N/A N/A N/A self father responseHeaders addRawHeader Content-Type text/html N/A N/A N/A N/A self father write <H1>Could not connect</H1> N/A N/A N/A N/A self father finish N/A N/A ProxyRequest N/A Request N/A N/A 
    Used by Proxy to implement a simple web proxy.

    @ivar reactor: the reactor used to create connections.
    @type reactor: object providing L{twisted.internet.interfaces.IReactorTCP}
     N/A protocols N/A http ProxyClientFactory N/A ports N/A http 80 __init__ N/A N/A self channel queued reactor N/A reactor N/A N/A N/A N/A Request __init__ self channel queued N/A N/A self reactor reactor N/A process N/A N/A self N/A N/A N/A parsed N/A N/A urllib_parse urlparse N/A self uri N/A protocol N/A parsed N/A 0 N/A host N/A N/A N/A parsed N/A 1 decode ascii N/A port N/A N/A self ports N/A protocol N/A N/A : host N/A N/A N/A host port N/A N/A host split : N/A port N/A int port N/A rest N/A N/A urllib_parse urlunparse N/A N/A N/A parsed N/A 2 N/A N/A rest N/A N/A rest N/A rest / N/A class_ N/A N/A self protocols N/A protocol N/A headers N/A N/A N/A N/A self getAllHeaders copy N/A N/A host headers N/A N/A N/A headers N/A host N/A N/A host encode ascii N/A N/A N/A N/A self content seek 0 0 N/A s N/A N/A N/A self content read N/A clientFactory N/A class_ N/A self method rest N/A self clientproto headers s self N/A N/A N/A N/A self reactor connectTCP host port clientFactory N/A N/A Proxy N/A HTTPChannel N/A N/A 
    This class implements a simple web proxy.

    Since it inherits from L{twisted.web.http.HTTPChannel}, to use it you
    should do something like this::

        from twisted.web import http
        f = http.HTTPFactory()
        f.protocol = Proxy

    Make the HTTPFactory a listener on a port as per usual, and you have
    a fully-functioning web proxy!
     N/A requestFactory ProxyRequest N/A ReverseProxyRequest N/A Request N/A N/A 
    Used by ReverseProxy to implement a simple reverse proxy.

    @ivar proxyClientFactoryClass: a proxy client factory class, used to create
        new connections.
    @type proxyClientFactoryClass: L{ClientFactory}

    @ivar reactor: the reactor used to create connections.
    @type reactor: object providing L{twisted.internet.interfaces.IReactorTCP}
     N/A proxyClientFactoryClass ProxyClientFactory __init__ N/A N/A self channel queued reactor N/A reactor N/A N/A N/A N/A Request __init__ self channel queued N/A N/A self reactor reactor N/A process N/A N/A self N/A N/A N/A 
        Handle this request by connecting to the proxied server and forwarding
        it there, then forwarding the response back as the response to this
        request.
         N/A N/A N/A N/A self requestHeaders setRawHeaders host N/A N/A N/A N/A N/A self factory host encode ascii N/A clientFactory N/A N/A self proxyClientFactoryClass N/A self method N/A self uri N/A self clientproto N/A N/A self getAllHeaders N/A N/A N/A self content read self N/A N/A N/A N/A self reactor connectTCP N/A N/A self factory host N/A N/A self factory port clientFactory N/A N/A ReverseProxy N/A HTTPChannel N/A N/A 
    Implements a simple reverse proxy.

    For details of usage, see the file examples/reverse-proxy.py.
     N/A requestFactory ReverseProxyRequest N/A ReverseProxyResource N/A Resource N/A N/A 
    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.

    @ivar proxyClientFactoryClass: a proxy client factory class, used to create
        new connections.
    @type proxyClientFactoryClass: L{ClientFactory}

    @ivar reactor: the reactor used to create connections.
    @type reactor: object providing L{twisted.internet.interfaces.IReactorTCP}
     N/A proxyClientFactoryClass ProxyClientFactory __init__ N/A N/A self host port path reactor N/A reactor N/A N/A 
        @param host: the host of the web server to proxy.
        @type host: C{str}

        @param port: the port of the web server to proxy.
        @type port: C{port}

        @param path: the base path to fetch data from. Note that you shouldn't
            put any trailing slashes in it, it will be added automatically in
            request. For example, if you put B{/foo}, a request on B{/bar} will
            be proxied to B{/foo/bar}.  Any required encoding of special
            characters (such as " " or "/") should have been done already.

        @type path: C{str}
         N/A N/A N/A Resource __init__ self N/A N/A self host host N/A N/A self port port N/A N/A self path path N/A N/A self reactor reactor N/A getChild N/A N/A self path request N/A N/A N/A 
        Create and return a proxy resource with the same proxy configuration
        as this one, except that its path also contains the segment given by
        C{path} at the end.
         N/A N/A ReverseProxyResource N/A self host N/A self port N/A N/A N/A self path / N/A N/A N/A urlquote path safe encode utf-8 N/A self reactor N/A render N/A N/A self request N/A N/A N/A 
        Render a request by forwarding it to the proxied server.
         N/A N/A N/A self port 80 N/A N/A host N/A self host N/A N/A host N/A N/A N/A self host : N/A str N/A self port N/A N/A N/A N/A request requestHeaders setRawHeaders host N/A N/A N/A host encode ascii N/A N/A N/A N/A request content seek 0 0 N/A qs N/A N/A N/A urllib_parse urlparse N/A request uri N/A 4 N/A qs N/A N/A rest N/A N/A N/A self path ? qs N/A N/A rest N/A self path N/A clientFactory N/A N/A self proxyClientFactoryClass N/A request method rest N/A request clientproto N/A N/A request getAllHeaders N/A N/A N/A request content read request N/A N/A N/A N/A self reactor connectTCP N/A self host N/A self port clientFactory N/A NOT_DONE_YET N/A N/A