How HTTP proxies work: CONNECT tunnels, what the proxy sees, and setups that work in 2026

An HTTP proxy is the most common way to send traffic out through another IP, and many guides still describe it with standards that were replaced in 2022. Here is how it handles HTTP and HTTPS, what it can and cannot see, and setups for curl, Python, Node.js, Go and headless browsers that we ran through our own gateway.

APAeonProxy team·Oct 26, 2026·16 min read
THE SHORT VERSION

For plain http:// URLs an HTTP proxy receives the whole request and can read and change all of it. For https:// URLs the client sends CONNECT host:443, the proxy opens a blind tunnel and TLS runs end to end with the site, so the proxy sees the host name and the amount of traffic but not URLs, headers or content. An “HTTPS proxy” only means the connection to the proxy is encrypted; you do not need one to reach HTTPS sites. Use http:// in the proxy URL unless your provider says otherwise, never fix a proxy error by switching off certificate checks, and remember that a kept-alive connection keeps the same exit IP.

What an HTTP proxy is

RFC 9110, the HTTP standard since June 2022, defines a proxy as a message-forwarding agent the client chooses, usually in its own configuration, to send requests through. That is a forward proxy: you point your browser, scraper or app at it, and the sites you visit see the proxy’s IP address instead of yours. A reverse proxy is the opposite case, a server in front of a website, such as a CDN or a load balancer, which the site’s owner chooses.

An HTTP proxy speaks HTTP to your client, but it can carry both HTTP and HTTPS sites. There is no standard port: 8080 and 3128 (Squid’s default) are conventions, curl assumes 1080 when you leave the port out, and Chrome assumes 80. Our gateway answers on gate.aeonproxy.com:7000 for HTTP and 7001 for SOCKS5; the documentation lists the rest.

Plain HTTP through a proxy

For an http:// URL the client sends the proxy the whole request, with the full URL in the first line. RFC 9112 calls this the absolute form:

GET http://example.com/products?page=2 HTTP/1.1
Host: example.com
Proxy-Authorization: Basic YXBfYTFiMmMzOlBBU1M=
User-Agent: curl/8.5.0

The proxy resolves the host name, connects to the site, sends the request on and returns the answer. It reads and can change everything along the way: the URL, every header including cookies, the body and the response. RFC 9110 even requires a forwarding proxy to add a Via header to each message it passes on, and many proxies add X-Forwarded-For with your address. Our gateway adds neither, as the test further down shows, and it serves one plain HTTP request per connection.

Plain HTTP is rare on the web in 2026, so in practice this mode matters for old APIs, internal services and the occasional site that never moved to HTTPS.

HTTPS through a proxy: the CONNECT tunnel

For an https:// URL the client asks the proxy for a tunnel first. This is the real exchange with our gateway, the first attempt without credentials and the second with them:

CONNECT example.com:443 HTTP/1.1
Host: example.com:443

HTTP/1.1 407 Proxy Authentication Required
Proxy-Authenticate: Basic realm="AeonProxy"
X-Reason: login required
Connection: close

CONNECT example.com:443 HTTP/1.1
Host: example.com:443
Proxy-Authorization: Basic YXBfYTFiMmMzLWNjLXVzOlBBU1M=

HTTP/1.1 200 Connection Established

Any 2xx answer turns the connection into a tunnel, and from then on the standard restricts the proxy to “blind forwarding of data, in both directions”. Your client runs the TLS handshake with the site through the tunnel, so the encryption is end to end and the proxy only passes encrypted bytes. Two details catch people out: the CONNECT line itself, with the host name and the proxy credentials, travels unencrypted to the proxy, and curl still sends a Proxy-Connection: Keep-Alive header that RFC 9112 asks clients not to send.

HTTP/2 and HTTP/3 keep the same idea and run each tunnel on one stream of a shared connection (RFC 9113, RFC 9114). Classic CONNECT carries TCP only, though, and QUIC, the transport under HTTP/3, runs over UDP. Carrying it needs CONNECT-UDP from RFC 9298, which curl added as an experimental feature in version 8.21.0 in June 2026. Through an ordinary HTTP proxy, your browser reaches sites over TCP with HTTP/1.1 or HTTP/2.

What the proxy can and cannot see

Plain HTTPHTTPS through CONNECTTLS-inspecting proxy
Your IP addressYesYesYes
Host name and port of the siteYesYes, in the CONNECT lineYes
Your proxy credentialsYesYesYes
Timing and amount of trafficYesYesYes
Full URL and pathYesNoYes
Headers, cookies, loginsYesNoYes
Request and response contentYes, and can change itNoYes, and can change it

A TLS-inspecting proxy, common in companies, decrypts traffic with a certificate authority that has to be installed on your machine. A proxy you use for scraping or geo checks never needs that. Encrypted Client Hello, published as RFC 9849 in March 2026, does not hide the site from an HTTP proxy either, because the host name is already in the CONNECT line.

What a provider stores is up to its policy. Ours does not store the sites you visit; it keeps a session log (account, session, your IP, start and end) for 14 days, as our Privacy Policy explains.

HTTP proxy or HTTPS proxy?

The names suggest that an HTTP proxy handles HTTP sites and an HTTPS proxy handles HTTPS sites. They do not mean that. The urllib3 documentation puts it plainly: both carry HTTP and HTTPS destinations, and the only difference is whether the client opens a TLS connection to the proxy first. An HTTPS proxy hides the CONNECT line and your credentials from the local network, which is worth having on public Wi-Fi.

Support is broad: curl since version 7.52.0 in 2016, Chrome through PAC files, flags or policy, urllib3 and requests, httpx since 0.25.0, Node.js and undici, Go and axios. aiohttp’s support is limited, and Playwright documents HTTP and SOCKS proxy servers. If you use an HTTPS proxy with Python, update urllib3 to 2.8.0 or later: that release of 15 September 2026 fixed a high-severity bug where TLS settings for HTTPS proxies could be ignored.

The common bug runs the other way: writing https:// for a proxy that only speaks plain HTTP. In a Python proxies dictionary the key is the scheme of the site you visit, and the value’s scheme is how you reach the proxy, so the usual correct form is "https": "http://…". Most proxies answer the mistake with bytes your TLS library reports as “wrong version number”. Our gateway, which speaks plain HTTP on port 7000, waits for a request that never comes, so the same mistake shows up as a timeout.

Authentication, and settings in the username

Proxies use their own header pair: a 407 answer with Proxy-Authenticate, and Proxy-Authorization on the retry. Both apply only between you and the proxy, which consumes them. The usual scheme is Basic, which is base64 and therefore readable by anyone on the path; RFC 7617 warns that it sends the password in clear text. With an http:// proxy URL, that includes HTTPS requests, because the CONNECT line goes out before any encryption starts.

Many providers carry settings in the username. Ours takes the country, state, city, network or carrier, and a sticky-session key with a hold time: ap_a1b2c3-cc-us-st-texas-sid-job42-time-1800 means a Texas exit held for 30 minutes. Those settings are as visible on the wire as the password, and a mistake in them is an authentication failure: our gateway answers an unknown city with 407 and X-Reason: unknown city instead of falling back to the whole country without telling you.

  • Percent-encode special characters in a URL-form password: @ becomes %40 and : becomes %3A.
  • Keep credentials out of shell history and images. curl’s manual advises reading them from a file rather than the command line, and Docker stores proxy variables in plain text in a container’s configuration.
  • Chrome ignores a username and password written into its proxy settings, so headless browsers need their own authentication call, shown below.
  • Keep clients updated. Credential-leak bugs were fixed in requests 2.31.0 (CVE-2023-32681), urllib3 2.2.2, axios 1.16.1, curl 8.20.0 and, on 18 June 2026, Node.js (CVE-2026-48615, credentials in tunnel errors).

Setups that work in 2026

We checked these against the documentation of curl 8.23, requests 2.34, httpx 0.28, aiohttp 3.14, Node.js 24, undici 8, Go 1.27, Playwright 1.64, Puppeteer 25 and Selenium 4.51 on 26 October 2026, and ran the curl, requests, Node.js built-in and Playwright examples through our gateway. Replace the login and PASS with your own.

curl

# HTTPS through the proxy: curl sends CONNECT on its own
curl -x http://gate.aeonproxy.com:7000 \
  -U "ap_a1b2c3-cc-us:PASS" https://api.ipify.org

# watch the CONNECT exchange
curl -sv -o /dev/null -x http://gate.aeonproxy.com:7000 \
  -U "ap_a1b2c3-cc-us:PASS" https://example.com

# force a tunnel for a plain-HTTP URL, or skip the proxy for some hosts
curl -p -x http://gate.aeonproxy.com:7000 -U "ap_a1b2c3-cc-us:PASS" http://example.com
curl --noproxy "localhost,127.0.0.1" http://localhost:3000

curl 8.7.0 and later can print %{proxy_used} with -w to confirm a proxy was used. To unset a proxy taken from the environment for one call, pass -x "".

Python

import requests

PROXY = "http://ap_a1b2c3-cc-de:PASS@gate.aeonproxy.com:7000"   # http:// even for HTTPS sites
r = requests.get("https://api.ipify.org?format=json",
                 proxies={"http": PROXY, "https": PROXY}, timeout=30)
print(r.json())

# httpx 0.28: the argument is proxy=, the old proxies= was removed
import httpx
with httpx.Client(proxy=PROXY, timeout=30) as client:
    print(client.get("https://api.ipify.org").text)

# aiohttp 3.14: credentials in the URL (proxy_auth is deprecated)
import aiohttp, asyncio
async def main():
    async with aiohttp.ClientSession() as s:
        async with s.get("https://api.ipify.org", proxy=PROXY) as resp:
            print(await resp.text())
asyncio.run(main())

Pass proxies= on each requests call rather than relying on session.proxies, which environment variables can override. httpx itself has been quiet since 2024, and since May 2026 Pydantic maintains a continuation called httpx2 with the same proxy API.

Node.js

// Node 24.5+ or 22.21+: fetch, http and https follow the environment
// NODE_USE_ENV_PROXY=1 HTTPS_PROXY=http://ap_a1b2c3-cc-us:PASS@gate.aeonproxy.com:7000 node app.mjs
const ip = await (await fetch("https://api.ipify.org")).text();

// any version: undici's ProxyAgent as the dispatcher
import { ProxyAgent, fetch as ufetch } from "undici";
const dispatcher = new ProxyAgent("http://ap_a1b2c3-cc-us:PASS@gate.aeonproxy.com:7000");
console.log(await (await ufetch("https://api.ipify.org", { dispatcher })).text());

// axios opens the CONNECT tunnel itself for HTTPS targets
const res = await axios.get("https://api.ipify.org", {
  proxy: { protocol: "http", host: "gate.aeonproxy.com", port: 7000,
           auth: { username: "ap_a1b2c3-cc-us", password: "PASS" } },
});

https-proxy-agent works too, but has been an ES module only since version 8 in March 2026.

Go

u, _ := url.Parse("http://ap_a1b2c3-cc-us:PASS@gate.aeonproxy.com:7000")
client := &http.Client{
    Transport: &http.Transport{Proxy: http.ProxyURL(u)},
    Timeout:   30 * time.Second,
}
resp, err := client.Get("https://api.ipify.org")

Headless browsers

// Playwright: credentials go in their own fields
const browser = await chromium.launch({ proxy: {
  server: "http://gate.aeonproxy.com:7000",
  username: "ap_a1b2c3-cc-gb-sid-pw01-time-600", password: "PASS",
} });

// Puppeteer: the flag carries host and port, page.authenticate the login
const browser2 = await puppeteer.launch({ args: ["--proxy-server=http://gate.aeonproxy.com:7000"] });
const page = await browser2.newPage();
await page.authenticate({ username: "ap_a1b2c3-cc-gb", password: "PASS" });

Puppeteer turns on request interception behind the scenes to answer the 407, which costs some speed. For Selenium with Chrome, credentials in --proxy-server are ignored, and Selenium Wire, the old workaround, is no longer maintained. Selenium 4’s BiDi authentication handlers are the newer route; test that they answer your proxy’s 407 before you rely on them, or run a small local forwarding proxy that adds the credentials.

HTTP_PROXY, HTTPS_PROXY and NO_PROXY

No standard defines these variables, which Docker’s documentation admits while pointing to GitLab’s 2021 survey of the differences. In each name the scheme is the site’s (https_proxy is used for https:// URLs), and the value says how to reach the proxy. The tools disagree on almost everything else:

ToolReadsOn by default?Notes
curlhttp_proxy in lowercase only; other names in either case; ALL_PROXYYesIgnores uppercase HTTP_PROXY because of httpoxy; NO_PROXY takes CIDR since 7.86.0
Python requestsBoth cases, plus ALL_PROXYYesEnvironment overrides session.proxies; 2.34.0 stopped greedy no_proxy matching
httpxHTTP_PROXY, HTTPS_PROXY, ALL_PROXY, NO_PROXYYestrust_env=False turns it off
aiohttpStandard library lookupNoNeeds trust_env=True
Node.js 24.5+, 22.21+Both cases, lowercase wins; no ALL_PROXYNoNODE_USE_ENV_PROXY=1 or --use-env-proxy; Node 22 prints an “experimental” warning
GoBoth cases, lowercase winsYes, in the default transportRead once per process; localhost is never proxied
Dockerproxies in ~/.docker/config.jsonFor new containers and buildsSets both cases; stored in plain text in the container’s configuration

A recipe that works across all of them: set the lowercase and uppercase names to the same value, use an http:// value unless the proxy really speaks TLS, list plain host names and domains in NO_PROXY together with localhost,127.0.0.1,::1, opt in explicitly in Node.js and aiohttp, and in Go set the variables before the first request. Do not rely on wildcards, IP ranges or CIDR in NO_PROXY unless every tool in the chain supports them.

The lowercase rule has a security reason. A web server running CGI scripts turns an incoming Proxy: request header into an HTTP_PROXY variable, so a client that trusted the uppercase name could be steered to an attacker’s proxy. The flaw got the name httpoxy and a set of CVEs in 2016; curl had avoided it since 2001.

Rotation, sticky sessions and keep-alive

On a rotating gateway the exit is chosen per connection, and clients reuse connections whenever they can. We sent four requests through a rotating login, first with a requests.Session, then with four separate requests.get calls:

Session, 4 calls:        178.24.248.153  178.24.248.153  178.24.248.153  178.24.248.153
separate calls, 4 calls: 93.196.161.171  92.208.173.105  92.209.158.152  95.91.231.56

The session kept its tunnel open, so all four requests left from the same household. If you want a new IP for every request, open a new connection for each one: a new client, or no shared session. If you want the same IP across connections, ask for it explicitly with a sticky session, -sid-<key>-time-<seconds>, held for up to 6 hours on our residential and mobile proxies. Clients differ here: in the same test, Node.js fetch with the built-in environment proxy got a new exit on each of two calls, so check your own client before you build on either behaviour.

Headers, anonymity levels and how sites really detect proxies

Free proxy lists still sort proxies into transparent (passes your IP in a header), anonymous (says it is a proxy) and elite (adds nothing). The labels only describe plain HTTP. Inside a CONNECT tunnel a proxy cannot add headers to your HTTPS requests at all, so for HTTPS work the classification says next to nothing.

We checked what a site sees through our gateway: httpbin’s header echo received Accept, Host, User-Agent and the trace header its own load balancer adds, the same four as a direct request, in 12 of 12 plain HTTP and 12 of 12 HTTPS requests. No Via, X-Forwarded-For or Forwarded.

Sites detect proxies by other means. The IP address and its network are the first signal: hosting ranges are public and IP databases flag proxy exits. Next comes the client: Cloudflare and others compare the TLS fingerprint with the browser the User-Agent claims, and because a proxy terminates TCP, the server sees the proxy’s TCP stack rather than your computer’s. Latency and browser leaks such as WebRTC complete the picture. The IP checker shows these signals for your own connection, and our guide to checking a proxy IP covers the network side.

Troubleshooting by symptom

Ask one question first: did the error come back as the answer to CONNECT, or from inside a tunnel that already opened? An answer to CONNECT comes from the proxy; anything after 200 Connection Established comes from the site. curl -v shows which. The codes below are the ones our gateway sends, with its X-Reason header naming the cause:

SymptomWho answeredLikely causeFix
407, X-Reason: bad credentials or bad usernameThe proxyWrong login or password, or an unencoded special characterCheck both, percent-encode, use the browser’s authentication call
407, X-Reason: unknown city (or region, ISP, carrier)The proxyA targeting key the gateway does not knowUse the names from the dashboard’s lists
402The proxyNo traffic left on the plan or the sub-user limitTop up or raise the limit
403 on CONNECT, with an X-ReasonThe proxyA target blocked by default, such as government sites or mail portsPick another target, or ask support
429 from the proxyThe proxyToo many failed logins from your addressFix the credentials, then wait
502 or 504The proxy, about its upstreamThe exit failed or timed outRetry; a rotating login picks another exit
403, 429 or a CAPTCHA after the tunnel openedThe siteBot defences, rate limits, reputationSlow down, fix the client, then consider another proxy type
Timeout or “wrong version number”Your clienthttps:// used for a plain-HTTP proxyUse http:// in the proxy URL
Certificate errorsA TLS-inspecting proxyIts certificate authority is not trustedInstall that authority (for example with REQUESTS_CA_BUNDLE); never disable verification
Connection reset mid-transferEither sideThe tunnel closed, an idle timeout, or a sticky session endedRetry, and keep jobs shorter than the session

In Python a failed proxy login looks like this:

ProxyError('Unable to connect to proxy',
  OSError('Tunnel connection failed: 407 Proxy Authentication Required'))

Some proxies also send a Proxy-Status header (RFC 9209) with a standard error type such as dns_timeout or connection_refused. To confirm where you exit, request https://api.ipify.org through the proxy, or open the IP checker in the same browser profile; the proxy tester checks a whole list at once.

What a proxy hop costs in time

Every proxied HTTPS request pays for extra round trips: the CONNECT exchange, the proxy’s own connection to the site, and on residential and mobile proxies the detour through somebody’s device. We timed it on 26 October 2026 from a server in France, with a new connection for each of 30 requests per row, exits in the US, UK and Germany:

PathConnected to the proxyTunnel openTLS doneFirst byte
Direct, no proxyNot neededNot needed15 ms65 ms
Residential, HTTP CONNECT12 ms200 ms303 ms479 ms
Mobile, HTTP CONNECT12 ms321 ms547 ms786 ms

Figures are medians. Reusing a connection skips the CONNECT and TLS steps after the first request. That makes keep-alive much faster, and it also keeps you on one exit. Browsers have a limit of their own: Chrome allows HTTP/1.1 proxies 32 simultaneous connections across all sites, while HTTPS proxies that negotiate HTTP/2 multiplex many tunnels over one connection.

Free proxies and certificate warnings

The best measurements of free proxies are from 2018, and nothing newer we found suggests things improved. A study presented at NDSS 2018 found 38% of open HTTP proxies modifying content and 5.15% doing something malicious, mostly injecting ads, tracking code or redirects to malware. Another 2018 study of 107,000 open proxies found more than 92% unresponsive and caught others injecting cryptominers, intercepting TLS and serving binaries with remote-access trojans.

Some tutorials answer proxy TLS errors with verify=False or curl -k. That switches off the check that tells you whether you are talking to the real site, so it hides exactly the interception you should worry about. If a corporate proxy inspects TLS, install its certificate authority (REQUESTS_CA_BUNDLE in Python, --proxy-cacert in curl for an HTTPS proxy). If a proxy you bought asks you to install a certificate authority, do not use it.

HTTP or SOCKS5?

UseHTTP proxySOCKS5
Browsers, headless browsers, HTTP APIsThe default: supported everywhere, with authenticationChrome supports it without authentication and without UDP
Non-HTTP protocols: SSH, databases, mail clients, gamesOnly through CONNECT, if the proxy allows the portBuilt for it
UDP: DNS, QUIC, voice, gamesNoWith UDP ASSOCIATE, which our port 7001 supports
Where DNS is resolvedOn the proxyOn the proxy with socks5h://, on your machine with socks5://
EncryptionNone to the proxy unless it is an HTTPS proxyNone

Neither is faster as a rule. Our SOCKS5 guide covers the protocol, UDP and setup in the same detail.

What changed in 2024–2026

Most pages on this topic predate these changes, and several of them break old code:

DateChange
28 Nov 2024httpx 0.28.0 removes the proxies= argument; use proxy= or mounts=
31 Jul 2025Node.js 24.5.0 adds built-in proxy support and --use-env-proxy; 22.21.0 follows on 20 October
Jan–Feb 2026Node.js 25.4.0 and 24.14.0 add http.setGlobalProxyFromEnv(), which also covers fetch
Mar 2026Encrypted Client Hello becomes RFC 9849; https-proxy-agent 8 becomes an ES module only
11 May 2026requests 2.34.0 stops greedy no_proxy domain matching
12 May 2026Pydantic releases httpx2, a maintained continuation of httpx
1 Jun 2026aiohttp 3.14.0 deprecates proxy_auth
18 Jun 2026Node.js fixes CVE-2026-48615, proxy credentials in tunnel errors
24 Jun 2026curl 8.21.0 adds experimental HTTP/3 proxying and CONNECT-UDP
15 Sep 2026urllib3 2.8.0 fixes TLS settings for HTTPS proxies being ignored

Sources: the httpx changelog, Node.js documentation, requests history, httpx2, aiohttp documentation, curl changes and the urllib3 changelog.

Use it on public data

Our Acceptable Use Policy allows public data collection, price and ad checks, search monitoring and testing, and bans credential stuffing, fake accounts and overloading sites. Keep request rates reasonable and slow down when a site answers 429 or 503.

Published Oct 26, 2026. We update this guide when the platforms change; dated facts above are as of publication.

Frequently asked questions

Not the content. Through a CONNECT tunnel it sees the site’s host name, your IP, your proxy credentials and how much data passes, but not URLs, headers or pages. Only a TLS-inspecting proxy with a certificate authority installed on your machine can read HTTPS.

Both carry HTTP and HTTPS sites. An HTTPS proxy encrypts the connection between you and the proxy, which hides the CONNECT line and your credentials from the local network.

Yes. The client asks for a tunnel with CONNECT and runs TLS with the site through it, so the encryption stays end to end.

The proxy did not accept your credentials: a wrong login or password, a special character that was not percent-encoded, or a browser that ignored credentials in its proxy settings. On our gateway the X-Reason header says which part failed.

Yes, and tools disagree. curl reads only lowercase http_proxy, Node.js and Go prefer lowercase, and Python reads both. Set both cases to the same value.

Use a comma-separated list of plain host names and domains plus localhost, 127.0.0.1 and ::1. Wildcards, IP ranges and CIDR work only in some tools and versions.

Whatever the provider configures; there is no standard. Common choices are 8080 and 3128, curl assumes 1080 when you omit it, and our gateway uses 7000 for HTTP and 7001 for SOCKS5.

No. With an HTTP proxy the proxy resolves the site’s name. DNS leaks are a SOCKS question: use socks5h:// so the proxy resolves names.

Neither is faster as a rule, and neither encrypts. Use SOCKS5 for non-HTTP protocols and UDP, an HTTP proxy for browsers and HTTP clients.

Request an IP echo service such as api.ipify.org through the proxy, or open an IP checker in the same browser profile, which also shows WebRTC and DNS leaks.

Related pages

Send your first request through our gateway.