Python requests proxy integration
The requests library reads a proxies dictionary on every call, so pointing Python at a Murphy gateway takes two lines. Put your username and password in the proxy URL and the same credentials cover HTTP and HTTPS traffic. For SOCKS5 support, install requests with the socks extra (pip install requests[socks]).
import requests
# Murphy gateway. Credentials go straight in the URL (user:pass@host:port).
proxy = "http://USERNAME:PASSWORD@gateway.murphyproxies.com:8000"
proxies = {"http": proxy, "https": proxy}
resp = requests.get(
"https://httpbin.org/ip",
proxies=proxies,
timeout=30,
)
print(resp.status_code, resp.json())
# SOCKS5 instead of HTTP (needs: pip install requests[socks])
# proxy = "socks5://USERNAME:PASSWORD@gateway.murphyproxies.com:8000"Setup in 5 steps
- 1Install the client with pip install requests (add requests[socks] for SOCKS5).
- 2Build the proxy URL as user:pass@gateway.murphyproxies.com:8000 using your Murphy credentials.
- 3Pass a proxies dict mapping both http and https to that URL on every request.
- 4Set a timeout so a stalled connection fails fast instead of hanging your run.
- 5Print resp.json() from an IP echo endpoint to confirm the request left through the proxy.
Python requests proxy questions
Everything you need to route Python requests through Murphy, from authentication to rotation.
Put the credentials in the proxy URL itself, in the form http://USERNAME:PASSWORD@gateway.murphyproxies.com:8000. requests reads the user and password from the URL, so you do not need a separate auth header or a ProxyManager.
Yes. Install the SOCKS dependency with pip install requests[socks], then change the scheme in the proxy URL to socks5 (or socks5h to resolve DNS through the proxy). Everything else in the code stays the same.
Rotation is controlled through the username you pass to the gateway. Use your base username to draw a fresh IP per request, or add a session token to keep the same IP across several calls. The requests code does not change, only the credential string does.
Get credentials for Python requests
Pick the network that fits your target. ISP proxies for fast, stable sessions, residential proxies for broad IP diversity against strict anti-bot systems.