Running¶
wsgi-proxy command¶
The package also installs wsgi-proxy command on your system. It runs a proxy server on your system.
$ wsgi-proxy -p 8080
You can change the server implementation using --server
option.
Default is waitress
.
$ wsgi-proxy --server wsgiref
$ wsgi-proxy --server cherrypy
WSGI application¶
The package provides a WSGI app that implements HTTP proxy as its name says. You can serve the application using any WSGI servers like Green Unicorn or Tornado. The application endpoint is:
wsgi_proxy.app
(or some servers accept wsgi_proxy:app
).
The following list shows some examples:
- Green Unicorn
$ pip install gunicorn $ gunicorn wsgi_proxy:app
- Tornado
$ pip install tornado
from tornado.httpserver import HTTPServer from tornado.ioloop import IOLoop from tornado.wsgi import WSGIContainer from wsgi_proxy import app container = WSGIContainer(app) http_server = HTTPServer(container) http_server.listen(8080) IOLoop.instance().start()
See also
- Servers which support WSGI — WSGI.org
- An alphabetic list of WSGI servers.