dropstride.
CLIENT SETUP

Use an HTTP proxy in Python with urllib

The quick answerPython’s standard library can send HTTP and HTTPS requests through an authenticated HTTP proxy. Create a ProxyHandler for both schemes, percent-encode each credential, and use the default TLS trust store for the HTTPS destination.

Check the endpoint before running the example

Wait for a ready order, confirm time and traffic remain, and copy the proxy IP, port, username and password. Use an HTTP proxy URL even when the destination starts with HTTPS. The HTTPS connection uses a CONNECT tunnel.

Dropstride supports public destination ports 80 and 443. The HTTP connection to the proxy does not encrypt proxy authentication, so use a trusted network and keep credentials private. Do not share command output containing credentials.

Understand HTTP proxies and HTTPS CONNECT →

Run the standard-library example

Save the example as python-proxy.py and run python3 python-proxy.py. It asks for the proxy fields and hides the password prompt. No pip package is required. The fixture used Python 3.14.4.

The proxy URL is held in memory and is not printed. Encode the username and password separately: characters such as @, / and : must not be interpreted as URL separators. The timeout bounds blocking socket operations, not the entire lifetime of an arbitrary long stream.

import getpass
import ssl
import urllib.error
import urllib.parse
import urllib.request

host = input("Proxy IP: ").strip()
port = int(input("Proxy port: "))
username = input("Proxy username: ").strip()
password = getpass.getpass("Proxy password: ")
# Encode credentials, not the complete URL. A colon/@ in a password is data.
auth = urllib.parse.quote(username, safe="") + ":" + urllib.parse.quote(password, safe="")
proxy = f"http://{auth}@{host}:{port}"
opener = urllib.request.build_opener(
    urllib.request.ProxyHandler({"http": proxy, "https": proxy}),
    urllib.request.HTTPSHandler(context=ssl.create_default_context()),
)
try:
    with opener.open("https://example.com", timeout=30) as response:
        response.read(1024)  # Small connectivity check; not a page-size measurement.
        print("Destination HTTP status:", response.status)
except urllib.error.HTTPError as error:
    print("HTTP error:", error.code)
    raise SystemExit(1)
except (urllib.error.URLError, TimeoutError):
    # Do not print the proxy URL or the exception object: they can contain secrets.
    print("Connection failed. Check rental status, proxy fields, network and TLS trust.")
    raise SystemExit(1)

Download the Python urllib example →

Keep proxy settings scoped to this client

The opener handles the requests you send through opener.open; it does not change other libraries or global Python connections. Supplying both http and https mappings covers both destination schemes using the same HTTP proxy endpoint.

Environment bypass settings such as no_proxy can still exclude hosts. Review them when verifying the exit IP. Do not install a permissive TLS context or disable hostname checking to work around a certificate failure.

Separate HTTP responses from connection errors

HTTPError exposes the status code. URLError can wrap a refused CONNECT, connection failure or TLS problem. Catch and sanitize errors before sharing them, because a proxy URL may include credentials.

For an expired or exhausted rental, changing Python authentication code will not restore service. First check the order and individual proxy allowance, then run the small curl check to separate client configuration from relay reachability.

What we actually tested

On 7 November 2026, a controlled local proxy accepted the authenticated request and relayed it to an isolated HTTP or HTTPS origin. The HTTPS certificate was verified against a local test certificate authority; verification was not disabled. The origin received no Proxy-Authorization header.

This proves the demonstrated protocol configuration in the listed versions. It does not measure a live Dropstride public exit IP, cloud availability, retailer acceptance, purchasing bots, speed or checkout success. After delivery, use a public IP-check service you trust to verify the assigned exit IP separately.

Read the sanitized protocol test results →

How we review and test published guides →

Sources and verification

Tested versions: python 3.14.4.

Product facts describe the current offer. Protocol sources and controlled tests have the scope stated in the article.

Python urllib.request ProxyHandler ↗ (checked 7 November 2026)Python URL quoting ↗ (checked 7 November 2026)Dropstride protocol and product limits ↗ (checked 7 November 2026)