Skip to main content

UNKNOWN

Project description

Installation

With pip:

$ pip install WSGIProxy2

Install optionnal backends:

$ pip install requests restkit 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')

Use restkit. This client support request and response streaming but does not support python3 (will be fixed with the next release):

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

Changes

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

WSGIProxy2-0.3.zip (17.7 kB view details)

Uploaded Source

File details

Details for the file WSGIProxy2-0.3.zip.

File metadata

  • Download URL: WSGIProxy2-0.3.zip
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for WSGIProxy2-0.3.zip
Algorithm Hash digest
SHA256 ade44a82d70ce3d5a041eaccb99176f1d300ac15a26073e5e8a62d7f93a1ceca
MD5 8b2cb207932eb8c341c3fa41f0cbe994
BLAKE2b-256 044a82cf539326951609475fe5b1b9f85cc4f06c62c303f44a352c9245f4dc00

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page