Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A WSGI Proxy with various http client backends
Python Makefile
tree: a057c4f90e

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
docs
wsgi_proxy
CHANGES.rst
README.rst
README_fixt.py
bootstrap.py
buildout.cfg
requirements.txt
setup.cfg
setup.py
tox.ini

README.rst

Installation

With pip:

$ pip install wsgi_proxy

Install optionnal backends:

$ pip install requests restkit urllib3

Usage

Create a proxy:

>>> from wsgi_proxy 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.

Use requests_:

>>> proxy = HostProxy(application_url, client='requests')

Use restkit_:

>>> proxy = HostProxy(application_url, client='restkit') # doctest: +SKIP

Use urllib3:

>>> proxy = HostProxy(application_url, client='urllib3')
Something went wrong with that request. Please try again.