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.

Files for requests-proxy-adapter, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size requests_proxy_adapter-0.1.1.tar.gz (179.1 kB) File type Source Python version None Upload date Hashes View
Filename, size requests_proxy_adapter-0.1.1-py2.py3-none-any.whl (5.8 kB) File type Wheel Python version py2.py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page