A WSGI Proxy with various http client backends
Project description
Installation
With pip:
$ pip install WSGIProxy2
Install optionnal 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) <html>... ...</html>
The Proxy application accept some keyword arguments. Those arguments are passed to the client during the process.
If no client as 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 support response streaming:
>>> proxy = HostProxy(application_url, client='requests')
Changes
0.5.1 (2021-08-26)
remove stale dep on six
use github actions as CI
0.5.0 (2021-08-18)
Drop support for python3.6 and bellow
0.4.6 (2019-02-22)
PATCH added into (default) list of allowed methods
0.4.5 (2018-09-19)
Allow to use URIs with no path
0.4.4 (2017-06-02)
Clean up connection before returning result. This removes some ResourceWarnings when testing
0.4.3 (2017-02-17)
Add OPTIONS to defaults allowed methods
Drop restkit support
Drop py26 support
0.4.2 (2014-12-20)
Undo webob’s unquoting to handle paths with percent quoted utf8 characters [Laurence Rowe]
0.4.1 (2013-12-21)
Include README_fixt.py in release
0.4 (2013-12-21)
fix tests.
change the way requests iter response
0.3 (2013-09-12)
Make allowed_methods check optional
0.2
Return the data not gzip decoded when using request
0.1
Initial release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file WSGIProxy2-0.5.1.tar.gz
.
File metadata
- Download URL: WSGIProxy2-0.5.1.tar.gz
- Upload date:
- Size: 16.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.14.0 pkginfo/1.4.2 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d9ecb141de720e2fd4f7a275a4a83a961ffeb6717483d940021ffa1c46f665c |
|
MD5 | 398ceb52cfd9add0c9a48e5ec7a7399b |
|
BLAKE2b-256 | f0aecad3131f771a38b4cdad6ca82bfee1800afc69758c70d0e70483ed1f6b30 |
File details
Details for the file WSGIProxy2-0.5.1-py3-none-any.whl
.
File metadata
- Download URL: WSGIProxy2-0.5.1-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.14.0 pkginfo/1.4.2 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37ab414dc568aba8c1fb0660885d05ab7ddde0a3460af90fea415afcdd7dfca8 |
|
MD5 | 0062c902519e05346cf3ddc575ba84ae |
|
BLAKE2b-256 | 4fb9472013e536aa22eba099becd8d1c8cddc1fd900303c60c75a643a59e41a3 |