proxylet 0.1.1 : Python Package Index
2012-04-30 07:52
441 查看
proxylet 0.1.1 : Python Package Index
Downloads ↓
proxylet 0.1.1
Lightweight HTTP reverse proxy built on eventletDownloads ↓
proxylet: lightweight HTTP reverse proxy built on eventlet This module implements a lightweight reverse proxy for HTTP, using non-blocking IO based on the eventlet module. It aims to do as little as possible while supporting simple request/response rewriting and being compatible with HTTP keep-alive. Basic operation is via the 'serve' function, which will bind to the specified host and port and start accepting incoming HTTP requests: proxylet.serve(host,port,mapper) Here 'mapper' is a function taking a proxylet.streams.HTTPRequest object, and returning either None (for '404 Not Found') or a 3-tuple giving the destination host, destination port, and a rewriter object. The rewriter can be any callable that takes request and response streams as arguments and returns wrapped versions of them, but it will most likely be a subclass of proxylet.relocate.Relocator. This class has the necessary logic to rewrite the request for proxying. As an example of the available functionality, this mapping function will proxy requests to /svn to a private subversion server, requests to /files to a private fileserver, and return 404 for any other paths: def mapper(req): svn = SVNRelocator("http://www.example.com/svn","http://svn.example.com/") if svn.matchesLocal(req.reqURI): return svn.mapping # contains the (host,port,rewriter) tuple if req.reqURI.startswith("/files/"): return ("files.example.com",80,None) return None
相关文章推荐
- django-cookieless 0.7 : Python Package Index
- pyrailgun 0.24 : Python Package Index
- APScheduler 2.0.3 : Python Package Index
- mmseg 1.2.5 : Python Package Index
- blinker 1.2 : Python Package Index
- Beaker 1.6.4 : Python Package Index
- bottle-session 0.2 : Python Package Index
- Ghost.py 0.1b3 : Python Package Index
- bottle-session 0.3 : Python Package Index
- colorama 0.2.4 : Python Package Index
- jenkinsapi 0.2.29 : Python Package Index
- retools 0.1 : Python Package Index
- tox 1.4.2 : Python Package Index
- Orchid 1.1 : Python Package Index
- detox 0.9 : Python Package Index
- django-sentry 1.13.5 : Python Package Index
- spider.py 0.5 : Python Package Index
- django-celery-email 1.0.3 : Python Package Index
- crawley 0.2.4 : Python Package Index
- suds 0.4 : Python Package Index