Did I find the right examples for you? yes no

All Samples(5)  |  Call(5)  |  Derive(0)  |  Import(0)
Override the default HTTPFactory to add support for a shared (among
all incoming requests) mapping of urls to request throttlers.

There is one factory for all incoming connections so shared state has
to stay here.

@ivar urlmapping: A C{dict} that maps hostnames to instances of
                        L{turtl.engine.ThrottlingDeferred}.

@ivar filter_rest: Define the behavior of unknown urls. If C{True}(more...)

src/t/u/turtl-0.1.1/examples/basic.py   turtl(Download)
 
urlmap, rest, port = config.loadConfigFromString(s)
f = proxy.TurtlHTTPFactory(urlmap, rest)
reactor.listenTCP(port, f)
reactor.run()

src/t/u/turtl-0.1.1/turtl/service.py   turtl(Download)
                desc = "Filtering"
            log.msg("%s unknown domains" % (desc,))
            f = proxy.TurtlHTTPFactory(urlmap, filter_rest)
            from twisted.internet import reactor
            reactor.listenTCP(port, f)

src/t/u/turtl-0.1.1/turtl/test/test_proxy.py   turtl(Download)
        channel = DummyChannel(transport)
        reactor = FakeReactor()
        proxy_factory = proxy.TurtlHTTPFactory({}, False, reactor)
        channel.factory = proxy_factory
        request = proxy.TurtlProxyRequest(channel, False, reactor)
        channel = DummyChannel(transport)
        reactor = FakeReactor()
        proxy_factory = proxy.TurtlHTTPFactory({}, False, reactor)
        channel.factory = proxy_factory
 
        throttler = FakeThrottler()
        urlmap = {'delicious.com': throttler}
        proxy_factory = proxy.TurtlHTTPFactory(urlmap, True, reactor)
        channel.factory = proxy_factory