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.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.1.tar.gz (6.5 kB view details)

Uploaded Source

File details

Details for the file WSGIProxy2-0.1.tar.gz.

File metadata

  • Download URL: WSGIProxy2-0.1.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for WSGIProxy2-0.1.tar.gz
Algorithm Hash digest
SHA256 1162147455aa0b2f9a83b0ba4c3f48840f8329d090647426f994bb790f9e5763
MD5 157049212f1c81a8790efa31146fbabf
BLAKE2b-256 613f09005a96f3926321e5b6b3eb3d6363bdff55c4872a1b44a2c5d774de6fa5

See more details on using hashes here.

Provenance

Supported by

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