What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
Configure a proxy in Python Requests by passing a proxies dictionary to the request. Use http:// for both entries when the proxy is an HTTP CONNECT proxy, even when the destination is HTTPS:
import requests
proxies = {
"http": "http://proxy.example:3128",
"https": "http://proxy.example:3128",
}
response = requests.get(
"https://example.org",
proxies=proxies,
timeout=30,
)
response.raise_for_status()
print(response.status_code)
For repeated calls, use a requests.Session. For process-wide defaults, set proxy environment variables. Always include a scheme in every proxy URL, protect credentials, keep TLS verification enabled, and use a finite timeout.
Choose the proxy scope first
Requests supports three practical scopes. A per-request mapping is the most explicit and is best when different destinations need different proxies. A Session centralizes settings for a group of calls. Environment variables are convenient for command-line programs, containers and CI jobs, but they can be inherited unexpectedly.
| Method | Scope | How to set it | Important behavior |
|---|---|---|---|
| Per request | One call | requests.get(..., proxies=proxies) |
Explicitly selects the proxy for that request. |
| Session | Calls made through one Session | session.proxies.update(proxies) |
Environment-derived settings can overwrite Session proxy values; pass proxies explicitly when selection must be guaranteed. |
| Environment | Process defaults | HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, NO_PROXY |
Used when a request does not supply an overriding mapping. |
Configure one request
The dictionary keys describe the destination scheme, not necessarily the proxy protocol. An HTTP proxy commonly handles both HTTP and HTTPS destinations:
#1 Best Overall
- 【WIRELESS MOBILE MINI TRAVEL ROUTER】 Convert a public network (wired or wireless) to a private Wi-Fi for secure surfing. Tethering. Powered by any laptop USB, power banks or 5V/2A DC adapters (sold separately). 39g (1.41 Oz) only, portable and pocket friendly. 2.4GHz ONLY
- 【OPEN SOURCE & PROGRAMMABLE】 OpenWrt pre-installed, USB disk extendable.
- 【LARGER STORAGE & EXTENDABILITY】 128MB RAM, 16MB Flash ROM, dual Ethernet ports, UART and GPIOs available for hardware DIY.
- 【OPENVPN CLIENT】 OpenVPN client pre-installed, compatible with 30+ VPN service providers.
- 【PACKAGE CONTENTS】 GL-MT300N-V2 (Mango) mini router (2-year Warranty), USB cable, Ethernet cable, User Manual. Please update to the latest firmware.
import requests
proxies = {
"http": "http://proxy.example:3128",
"https": "http://proxy.example:3128",
}
try:
response = requests.get(
"https://example.org",
proxies=proxies,
timeout=(10, 30),
)
response.raise_for_status()
except requests.exceptions.RequestException as exc:
print(f"Request failed: {type(exc).__name__}: {exc}")
else:
print(response.url, response.status_code)
print(response.text[:200])
The connect/read timeout tuple limits how long Requests waits to establish the connection and then to receive data. Adjust it for your network, but do not omit a timeout in production code.
Use different proxies by destination scheme
You can select separate endpoints:
proxies = {
"http": "http://http-proxy.example:3128",
"https": "http://secure-proxy.example:8080",
}
response = requests.get("https://example.org", proxies=proxies, timeout=30)
Each URL must include a scheme. Requests documentation states: “Note that proxy URLs must include the scheme.” A bare value such as proxy.example:3128 is invalid.
Reuse a proxy with a Session
A Session preserves connection pooling, cookies and shared configuration:
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsimport requests
proxies = {
"http": "http://proxy.example:3128",
"https": "http://proxy.example:3128",
}
session = requests.Session()
session.proxies.update(proxies)
response = session.get("https://example.org", timeout=30)
response.raise_for_status()
print(response.status_code)
Requests can also discover proxy values from the environment while preparing a request. Consequently, a Session value is not an absolute guarantee if environment settings are present. When the chosen proxy must win, pass the mapping on every call:
response = session.get(
"https://example.org",
proxies=proxies,
timeout=30,
)
Use environment variables
Requests recognizes lowercase and uppercase forms of http_proxy, https_proxy, all_proxy and no_proxy. In a Unix-like shell:
export HTTP_PROXY="http://proxy.example:3128"
export HTTPS_PROXY="http://proxy.example:3128"
export NO_PROXY="localhost,127.0.0.1,.internal.example"
python -c 'import requests; print(requests.get("https://example.org", timeout=30).status_code)'
Use NO_PROXY (or no_proxy) for hosts that must connect directly. Typical entries include loopback addresses and internal domains. Check the environment inherited by containers, CI runners and shells; an old variable can silently route traffic somewhere unexpected. An explicit proxies argument is the clearest way to override those defaults for a particular call.
Rank #2
- 【Advanced Home Data & Media Hub】For advanced home users who need phone backup, file storage, and centralized data management. Centralize family photos, 4K videos, movies, computer backups, and personal files in one place while running multiple apps for home entertainment and everyday data management. Suitable for households with growing digital libraries and multiple NAS use cases.
- 【Built for Creators, Media Servers & Advanced Apps】Powered by the Intel N100 Quad-Core CPU, 8GB DDR5 RAM, 2.5GbE networking, and dual M.2 NVMe slots, DXP2800 handles large files and heavier workloads with ease. Run Docker, virtual machines, and media server applications compatible with Plex—ideal for content creators, tech enthusiasts, and advanced home users managing 4K videos, RAW photos, personal media libraries, and multiple NAS apps.
- 【Up to 80TB for Growing Digital Libraries】 Supports up to 80TB of storage using two HDD bays and two M.2 NVMe SSD slots for family photos, movies, RAW photos, 4K videos, work files, and device backups. AI photo management supports recognition of people, objects, scenes, and locations, album organization, and duplicate photo detection. HDDs and SSDs are not included.
- 【AI-powered Home Surveillance】Turn DXP2800 into a centralized home surveillance hub by connecting compatible network cameras and storing recordings locally on your NAS. AI-powered features include Face Recognition, People Detection, and Pet Detection, helping advanced home users review important events more efficiently while managing home surveillance and personal data in one place.
- 【One data Center Across Your Devices】Keep files from desktops, laptops, phones, tablets, and other devices together instead of scattered across cloud accounts and external drives. Access, back up, organize, and share data across Windows, macOS, Android, iOS, web browsers, and compatible smart TVs—ideal for creators and advanced home users working across multiple devices.
Add proxy authentication safely
Basic credentials can be embedded in the proxy URL:
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchproxies = {
"http": "http://user:[email protected]:3128",
"https": "http://user:[email protected]:3128",
}
Treat the username and password as secrets. Do not commit them to source control, print them in logs or place long-lived credentials in shared environment configuration. Inject them at runtime from a secret manager. If a username or password contains reserved URL characters such as @, : or /, URL-encode that component before constructing the proxy URL; otherwise the parser can interpret it as part of the host or port.
Use a SOCKS proxy
SOCKS support is optional. Install the extra dependency in the same Python environment as your application:
python -m pip install 'requests[socks]'
Then choose whether DNS resolution occurs locally or through the proxy:
import requests
proxies = {
"http": "socks5h://user:[email protected]:1080",
"https": "socks5h://user:[email protected]:1080",
}
response = requests.get("https://example.org", proxies=proxies, timeout=30)
response.raise_for_status()
socks5://resolves the destination hostname on the client.socks5h://delegates hostname resolution to the proxy.
Use socks5h when DNS privacy or access to names resolvable only from the proxy network matters. Use socks5 when local DNS resolution is intentional and reachable.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Understand HTTPS and certificate verification
For an HTTPS destination, an HTTP proxy normally creates a CONNECT tunnel. If the proxy performs TLS interception instead, it presents a certificate signed by the organization’s proxy root. Your Python process must trust that root certificate.
Rank #3
- One Place for All Your Data - Consolidate scattered files from multiple computers, phones and external drives into one accessible hub with 100% ownership
- Professional File Collaboration - Share projects with clients, sync documents across teams and maintain version control without Dropbox fees
- Automated Backup Protection - Set-and-forget backups for Macs, PCs and mobile devices to multiple destinations including cloud and external drives
- DIY Surveillance System - Transform IP cameras into a professional monitoring solution with motion alerts, recording schedules and remote viewing
- 2-Year Warranty - Reliable hardware backed by Synology's expert customer support team and ongoing software updates
Requests uses its normal CA bundle by default. Point it at an approved corporate bundle with REQUESTS_CA_BUNDLE:
export REQUESTS_CA_BUNDLE="/path/to/corporate-proxy-ca.pem"
python app.py
You can also pass a CA-bundle path for one request:
response = requests.get(
"https://example.org",
proxies=proxies,
verify="/path/to/corporate-proxy-ca.pem",
timeout=30,
)
Keep verify=True, the default, or provide a trusted bundle. verify=False disables certificate and hostname checks and makes the application vulnerable to man-in-the-middle attacks. It is appropriate only for tightly controlled testing, never as a production fix for a certificate error. CURL_CA_BUNDLE is another environment variable Requests can use for a CA bundle.
Control bypass and host-specific routing
Besides scheme-wide entries, a mapping can target a particular scheme and host:
proxies = {
"http://10.20.1.128": "http://proxy.example:5323",
}
response = requests.get("http://10.20.1.128", proxies=proxies, timeout=30)
Document whether a host is intentionally direct or proxied. Review NO_PROXY before diagnosing a routing problem: an entry such as .internal.example can bypass the proxy for every matching subdomain, while a missing entry can send local services through an endpoint that cannot reach them.
Make proxy behavior observable without leaking secrets
When diagnosing configuration, print only sanitized values:
Rank #4
- Unlimited bandwidth, unlimited data.
- Super-fast VPN and one tap connect.
- Free worldwide multiple servers.
- Works with all type of data carries. (Wi-Fi, 4G, LTE, 3G).
- No registration, sign up needed.
import os
from urllib.parse import urlsplit, urlunsplit
def redact_proxy(value):
if not value:
return value
parts = urlsplit(value)
host = parts.hostname or ""
if parts.port:
host = f"{host}:{parts.port}"
return urlunsplit((parts.scheme, host, parts.path, parts.query, parts.fragment))
for name in ("HTTP_PROXY", "HTTPS_PROXY", "ALL_PROXY", "NO_PROXY"):
value = os.getenv(name) or os.getenv(name.lower())
if name == "NO_PROXY":
print(name, value)
else:
print(name, redact_proxy(value))
Log exception types such as ProxyError, ConnectTimeout, ReadTimeout and SSLError, but never log the complete proxy URL when it contains credentials. A small test against a known endpoint, followed by the real request, separates proxy connectivity from application errors.
Free tools Windows power users keep installed
One-click scans. No signup required.
Troubleshoot a failed proxied request
“Invalid proxy URL” or parsing errors
Confirm that every value starts with a scheme such as http://, https://, socks5:// or socks5h://. Check the host, numeric port and URL-encoded credentials.
The request ignores the Session proxy
Inspect uppercase and lowercase environment variables, then pass proxies=... explicitly on the request. This removes ambiguity caused by inherited environment configuration.
ProxyError or connection refused
Verify that the proxy host and port are reachable from this machine, that a firewall permits the connection, and that the proxy accepts the requested protocol. Test the proxy itself before debugging the destination website.
HTTPS certificate verification fails
Determine whether the proxy intercepts TLS. Obtain its trusted root certificate from the organization, set REQUESTS_CA_BUNDLE or pass verify with that bundle, and keep verification enabled. Do not solve the error by leaving verify=False in deployed code.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →SOCKS support is missing
Install requests[socks] in the active virtual environment. Then confirm whether the requirement is local DNS (socks5) or proxy-side DNS (socks5h).
Best Value
- Complete Phone & Computer Backup - Automatically protect photos, documents and videos from iPhone android, Mac and Windows to one secure location
- Your Private File Cloud - Access files from anywhere and share large projects with family or clients without relying on expensive cloud subscriptions
- Smart Home Security Hub - Monitor your home 24/7 with AI-powered surveillance that detects people, vehicles and sends instant alerts
- 100% Data Ownership - Keep full control of your personal data with multi-platform access and no monthly subscription fees
- 2-Year Warranty - Reliable hardware backed by Synology's expert customer support team and ongoing software updates
A supposedly direct host uses the proxy
Inspect NO_PROXY spelling, separators and domain patterns. Add explicit entries for localhost, 127.0.0.1 or internal suffixes when they must bypass the proxy.
The request hangs
Set a finite timeout, preferably a connect/read tuple. A slow proxy, unreachable destination or blocked CONNECT can otherwise leave a worker waiting indefinitely. Retry only when the operation is safe to repeat; avoid duplicating non-idempotent requests without an application-level idempotency strategy.
Operational guidance: reliability, performance and cost
- Reuse connections: a Session reduces repeated TCP and TLS setup for calls sharing a proxy.
- Limit concurrency: respect the proxy’s connection and rate limits; excessive parallelism can cause throttling or bans.
- Set bounded retries: retry transient connection failures with backoff, but do not retry authentication or certificate errors blindly.
- Measure the right layer: record elapsed time and exception class separately from destination HTTP status. A 502 from a proxy is not the same failure as a 502 generated by the origin.
- Keep configuration deterministic: pin the intended environment variables in deployment manifests and document
NO_PROXYbehavior. - Budget for proxy service usage: Requests itself does not publish a universal latency, success-rate or throughput guarantee for arbitrary proxies. Capacity, geography, authentication and provider limits determine the actual cost and performance.
Or skip the browser setup
If the task behind your automation is obtaining a clean website screenshot rather than making a general-purpose proxied HTTP call, ScreenshotNeo provides a single API request. It accepts cookie or consent banners before capture and removes more than 60 known consent platforms, newsletter popups and chat widgets. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and response headers identify the page verdict and billing result. Its MCP server exposes take_screenshot, get_page_info and capture_pdf to Claude, Cursor and other MCP clients.
cURL:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Python:
import requests
r = requests.get(
"https://api.screenshotneo.com/v1/shot",
params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
timeout=90,
)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)
Node.js:
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
See the ScreenshotNeo API documentation for the 63 capture options, including full-page lazy-image loading, CSS-selector element capture, device presets, retina scale, PDFs, custom CSS and JavaScript, clicks, waits, blocking rules, headers, cookies, geolocation, transparent backgrounds, resizing, caching, signed links, asynchronous webhooks, bulk capture and usage reporting. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. Sign up for the free 1,000-shot plan.
Frequently Asked Questions
Can I use an HTTPS proxy URL for an HTTPS destination?
Yes, when the proxy endpoint itself speaks HTTPS, use its documented HTTPS URL. Many HTTP CONNECT proxies are instead represented with an http:// proxy URL while tunneling an HTTPS destination.
Does Requests support proxy authentication headers separately?
The documented common form is credentials in the proxy URL. Keep those credentials out of source control and logs, and URL-encode reserved characters.
What is the safest default for certificate verification?
Leave verify=True and install the organization’s proxy CA bundle when TLS interception is used.
Recommended Free Tools
Should I choose socks5 or socks5h?
Choose socks5 for client-side DNS resolution and socks5h when the proxy should resolve the hostname.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

