Skip to main content

Adds the ability of using a proxy chains to the python requests module.

Project description

Requests chains

Adds the ability to use proxy chains directly the python requests module.

Import necessary modules

import requests
from requests_chains import chain_requests

Set up proxy chains

proxychains = [
  "socks5://127.0.0.1:9050",
  "socks5://user:pwd@ip:port"
]

chain_requests(proxychains) # Patch requests to use proxy chains

Done. Any requests from now on will be firstly send thorugh the chain specified.

How to add another proxy on top of this chain ? Simple!

With requests-chain you can just use the normal requests proxies built-in param to add a proxy, and that will be build on top of the chain specified!

r1 = s.get('http://api.ipify.org?format=json', proxies={"http":"socks5://proxy1:port1", "https":"socks5://proxy1:port1"})
r2 = s.get('http://api.ipify.org?format=json', proxies={"http":"socks5://proxy2:port2", "https":"socks5://proxy2:port2"})
print(r1.text)
  • r1 will firstly go through the whole chain and then on proxy1
  • r2 will firstly go through the whole chain and then on proxy2

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_chain-0.1.2.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

requests_chain-0.1.2-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

Details for the file requests_chain-0.1.2.tar.gz.

File metadata

  • Download URL: requests_chain-0.1.2.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.12

File hashes

Hashes for requests_chain-0.1.2.tar.gz
Algorithm Hash digest
SHA256 2ebbc05124a2594a75e936ec7b0a5aa47c1398942efe5c04444ec9e605cacf5b
MD5 cb8c20f0ac5738c98986dd85ad29f369
BLAKE2b-256 47bdfa9bcf2e1c6bc2392ff0675aece4a946339f67c1210a2c59961a2b455381

See more details on using hashes here.

File details

Details for the file requests_chain-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: requests_chain-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 16.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.12

File hashes

Hashes for requests_chain-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f3b2b6476c613a89bb6992f9819e5a52d89bd77a1d35871e61d2179a49903d48
MD5 34da71187f543216166c7a4ba4dc4ddd
BLAKE2b-256 8588e733b7bf0ec189b4dd59cd3f1b1e0c9a11dc84a18a7b4c1be0cf86792888

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