Did I find the right examples for you? yes no

All Samples(5)  |  Call(5)  |  Derive(0)  |  Import(0)
Redefine L{proxy.ProxyRequest} to add support for upcalling the
factory to decide whether to forward or filter a specific request.
If the request is blocked then return an error page to the client.

Also introduce a deferred that is fired once the forwarded host
request has completed, so that we can unlock the caller that could
be waiting for that to be over.

@ivar completed: a L{defer.Deferred} that is triggered once the
                    outgoing request has completed.

src/t/u/turtl-0.1.1/turtl/test/test_proxy.py   turtl(Download)
        proxy_factory = proxy.TurtlHTTPFactory({}, False, reactor)
        channel.factory = proxy_factory
        request = proxy.TurtlProxyRequest(channel, False, reactor)
        request.gotLength(len(data))
        request.handleContentChunk(data)
        channel.factory = proxy_factory
 
        request = proxy.TurtlProxyRequest(channel, False, reactor)
        request.gotLength(0)
        request.requestReceived('GET', 'http://example.com:1234/foo/bar',
        channel.factory = proxy_factory
 
        request = proxy.TurtlProxyRequest(channel, False, reactor)
        request.gotLength(0)
        request.requestReceived('GET', 'http://example.com:1234/foo/bar',
 
 
        request = proxy.TurtlProxyRequest(channel, False, reactor)
        request.gotLength(0)
        request.requestReceived('GET', 'http://delicious.com:1234/foo/bar',
 
 
        request = proxy.TurtlProxyRequest(channel, False, reactor)
        request.gotLength(0)
        request.requestHeaders.addRawHeader('x-priority', 'interactive')