Skip to content

Instantly share code, notes, and snippets.

@quantumproxies
quantumproxies / proxy-speed-test.sh
Created July 28, 2026 09:47
Proxy speed test: latency & throughput through a proxy vs direct, in pure curl — https://quantumproxies.io/residential-proxies
#!/usr/bin/env bash
# Proxy speed test: latency + download throughput through a proxy vs direct.
# Works with any HTTP proxy; example endpoint is QuantumProxies residential
# (rotating :9000) -> https://quantumproxies.io/residential-proxies
#
# export QP_USER=your_username QP_PASS=your_password
# ./proxy-speed-test.sh https://speed.cloudflare.com/__down?bytes=10000000
URL="${1:-https://speed.cloudflare.com/__down?bytes=10000000}"
PROXY="http://${QP_USER}:${QP_PASS}@residentialboson.quantumproxies.io:9000"
@quantumproxies
quantumproxies / proxy-speed-test.sh
Created July 28, 2026 09:47
Proxy speed test: latency & throughput through a proxy vs direct, in pure curl — https://quantumproxies.io/residential-proxies
#!/usr/bin/env bash
# Proxy speed test: latency + download throughput through a proxy vs direct.
# Works with any HTTP proxy; example endpoint is QuantumProxies residential
# (rotating :9000) -> https://quantumproxies.io/residential-proxies
#
# export QP_USER=your_username QP_PASS=your_password
# ./proxy-speed-test.sh https://speed.cloudflare.com/__down?bytes=10000000
URL="${1:-https://speed.cloudflare.com/__down?bytes=10000000}"
PROXY="http://${QP_USER}:${QP_PASS}@residentialboson.quantumproxies.io:9000"
@quantumproxies
quantumproxies / python-proxy-env-vars.py
Created July 28, 2026 09:47
HTTP_PROXY / HTTPS_PROXY in Python: trust_env, NO_PROXY and the pitfalls nobody documents — https://quantumproxies.io/rotating-proxies
# HTTP_PROXY / HTTPS_PROXY in Python: the pitfalls nobody documents.
#
# 1) requests reads env vars ONLY if trust_env is True (default) — and
# HTTPS_PROXY must still be an http:// URL (it's the scheme of the
# *target*, not of the proxy).
# 2) NO_PROXY beats both — a stray NO_PROXY=* silently disables everything.
# 3) urllib/requests lowercase vs uppercase: both are read, lowercase wins.
#
# Proxy used in the example: QuantumProxies rotating residential
# https://quantumproxies.io/rotating-proxies (creds: app.quantumproxies.io/register)
@quantumproxies
quantumproxies / python-proxy-env-vars.py
Created July 28, 2026 09:47
HTTP_PROXY / HTTPS_PROXY in Python: trust_env, NO_PROXY and the pitfalls nobody documents — https://quantumproxies.io/rotating-proxies
# HTTP_PROXY / HTTPS_PROXY in Python: the pitfalls nobody documents.
#
# 1) requests reads env vars ONLY if trust_env is True (default) — and
# HTTPS_PROXY must still be an http:// URL (it's the scheme of the
# *target*, not of the proxy).
# 2) NO_PROXY beats both — a stray NO_PROXY=* silently disables everything.
# 3) urllib/requests lowercase vs uppercase: both are read, lowercase wins.
#
# Proxy used in the example: QuantumProxies rotating residential
# https://quantumproxies.io/rotating-proxies (creds: app.quantumproxies.io/register)
@quantumproxies
quantumproxies / JavaProxyExample.java
Created July 28, 2026 09:47
Java 11+ HttpClient through an authenticated proxy — fixes the 407 Basic-auth tunneling gotcha — https://quantumproxies.io/residential-proxies
// Java 11+ HttpClient through an authenticated residential proxy.
//
// THE GOTCHA: since JDK 8u111, Basic auth on HTTPS tunnels is disabled by
// default. Without the system property below you get "407 Proxy
// Authentication Required" forever, even with a correct Authenticator.
//
// java -Djdk.http.auth.tunneling.disabledSchemes= JavaProxyExample.java
//
// Proxy: QuantumProxies residential — https://quantumproxies.io/residential-proxies
// Credentials: https://app.quantumproxies.io/register
@quantumproxies
quantumproxies / JavaProxyExample.java
Last active July 28, 2026 09:47
Java 11+ HttpClient through an authenticated proxy — fixes the 407 Basic-auth tunneling gotcha — https://quantumproxies.io/residential-proxies
// Java 11+ HttpClient through an authenticated residential proxy.
//
// THE GOTCHA: since JDK 8u111, Basic auth on HTTPS tunnels is disabled by
// default. Without the system property below you get "407 Proxy
// Authentication Required" forever, even with a correct Authenticator.
//
// java -Djdk.http.auth.tunneling.disabledSchemes= JavaProxyExample.java
//
// Proxy: QuantumProxies residential — https://quantumproxies.io/residential-proxies
// Credentials: https://app.quantumproxies.io/register
@quantumproxies
quantumproxies / CSharpProxyExample.cs
Created July 28, 2026 09:47
C# HttpClient with an authenticated residential proxy (.NET 6+, WebProxy + NetworkCredential) — https://quantumproxies.io/residential-proxies
// C# HttpClient behind an authenticated residential proxy (.NET 6+).
//
// Notes that save you an afternoon:
// - WebProxy + NetworkCredential handles the 407 dance automatically.
// - Reuse ONE HttpClient; a new handler per request leaks sockets.
// - Geo flags live in the proxy username (-country-de, -session-x1-lifetime-10).
//
// Proxy: QuantumProxies residential — https://quantumproxies.io/residential-proxies
// Credentials: https://app.quantumproxies.io/register
@quantumproxies
quantumproxies / CSharpProxyExample.cs
Created July 28, 2026 09:47
C# HttpClient with an authenticated residential proxy (.NET 6+, WebProxy + NetworkCredential) — https://quantumproxies.io/residential-proxies
// C# HttpClient behind an authenticated residential proxy (.NET 6+).
//
// Notes that save you an afternoon:
// - WebProxy + NetworkCredential handles the 407 dance automatically.
// - Reuse ONE HttpClient; a new handler per request leaks sockets.
// - Geo flags live in the proxy username (-country-de, -session-x1-lifetime-10).
//
// Proxy: QuantumProxies residential — https://quantumproxies.io/residential-proxies
// Credentials: https://app.quantumproxies.io/register
@quantumproxies
quantumproxies / rust-reqwest-proxy.rs
Created July 28, 2026 09:47
Rust: reqwest behind an authenticated residential proxy (inline URL vs basic_auth) — https://quantumproxies.io/residential-proxies
// Rust: reqwest through an authenticated residential proxy.
//
// Cargo.toml:
// reqwest = { version = "0.12", features = ["json", "socks"] }
// tokio = { version = "1", features = ["full"] }
//
// Proxy: QuantumProxies — https://quantumproxies.io/residential-proxies
// (rotating :9000, sticky :10000, SOCKS5 :12000 — flags in the username)
// Credentials: https://app.quantumproxies.io/register
@quantumproxies
quantumproxies / rust-reqwest-proxy.rs
Created July 28, 2026 09:47
Rust: reqwest behind an authenticated residential proxy (inline URL vs basic_auth) — https://quantumproxies.io/residential-proxies
// Rust: reqwest through an authenticated residential proxy.
//
// Cargo.toml:
// reqwest = { version = "0.12", features = ["json", "socks"] }
// tokio = { version = "1", features = ["full"] }
//
// Proxy: QuantumProxies — https://quantumproxies.io/residential-proxies
// (rotating :9000, sticky :10000, SOCKS5 :12000 — flags in the username)
// Credentials: https://app.quantumproxies.io/register