Skip to main content

Set of Proxy Transport Adapters fro Requests

Project description

https://img.shields.io/pypi/v/requests_proxy_adapter.svg https://img.shields.io/travis/Otetz/requests_proxy_adapter.svg Maintainability Documentation Status Updates

Set of Proxy Transport Adapters for Requests.

Features

  • PrivoxyAdapter – The transport adapter for Requests to use Privoxy proxy-server with retries when backend errors occurred.

  • RetryPrivoxyAdapter – The transport adapter for Requests to use Privoxy proxy-server with retries when backend errors occurred and retries if errors occured on target site by urllib3.util.retry module.

Usage

The simple exmaple of usage adapters (Privoxy run locally on 8118 port):

>>> import requests
>>> from requests_proxy_adapter import PrivoxyAdapter

>>> r = requests.get('http://httpbin.org/ip')
>>> public_ip = r.json()['origin']

>>> s = requests.Session()
>>> s.mount('http://', PrivoxyAdapter('http://localhost:8118'))
>>> r = s.get('http://httpbin.org/ip')
>>> assert r.status_code == 200

>>> anon_ip = r.json()['origin']
>>> assert anon_ip != public_ip

See also Requests Transport Adapters documentation.

Authors

Alexey Shevchenko <otetz@me.com>

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

requests_proxy_adapter-0.1.1.tar.gz (179.1 kB view hashes)

Uploaded Source

Built Distribution

requests_proxy_adapter-0.1.1-py2.py3-none-any.whl (5.8 kB view hashes)

Uploaded Python 2 Python 3

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