Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gawel/wsgiproxy2
A WSGI Proxy with various http client backends
https://github.com/gawel/wsgiproxy2
Last synced: 7 days ago
JSON representation
A WSGI Proxy with various http client backends
- Host: GitHub
- URL: https://github.com/gawel/wsgiproxy2
- Owner: gawel
- License: mit
- Created: 2012-12-19T23:33:45.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2024-11-16T23:46:06.000Z (about 1 month ago)
- Last Synced: 2024-12-02T12:05:00.048Z (20 days ago)
- Language: Python
- Homepage: https://wsgiproxy2.readthedocs.org/en/latest/
- Size: 76.2 KB
- Stars: 12
- Watchers: 6
- Forks: 17
- Open Issues: 4
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES.rst
- License: COPYING
Awesome Lists containing this project
README
Installation
============With pip::
$ pip install WSGIProxy2
Install optional backends::
$ pip install requests urllib3
Usage
=====Create a proxy::
>>> from wsgiproxy import HostProxy
>>> proxy = HostProxy(application_url)Then use it. Here is an example with WebOb but you can use it like a classic
WSGI application::>>> from webob import Request
>>> req = Request.blank('/form.html')
>>> resp = req.get_response(proxy)
>>> print(resp.text)
...
...The Proxy application accepts some keyword arguments. Those arguments are passed
to the client during the process.If no client is specified then python httplib is used. It's recommended to use
a more robust client able to manage a connection pool and stuff.Use `urllib3 `_::
>>> proxy = HostProxy(application_url, client='urllib3')
Use `requests `_. This client supports response streaming::
>>> proxy = HostProxy(application_url, client='requests')