ResidentialIPs.org

Glossary Proxy types

HTTP proxy

By the ResidentialIPs Editorial TeamUpdated

HTTP proxy: An HTTP proxy is a proxy that speaks the HTTP protocol. It fetches plain HTTP pages for you and, for HTTPS sites, opens an encrypted tunnel to the website using the CONNECT method.

Also called: web proxy, HTTP(S) proxy

Key takeaways

  • HTTP proxies are the most widely supported proxy type in browsers, libraries and tools.
  • For plain HTTP, the proxy reads and forwards the full request and response.
  • For HTTPS, the proxy opens a CONNECT tunnel and cannot see the encrypted content.
  • Authentication uses the 407 status code and the Proxy-Authorization header.
  • Use SOCKS5 instead for non-web protocols or UDP traffic.

What is an HTTP proxy?

An HTTP proxy is a proxy server that understands HTTP, the protocol of the web. Your client sends HTTP requests to the proxy, and the proxy forwards them to websites. Almost every commercial proxy provider offers an HTTP endpoint, and almost every tool can use one, which makes it the default choice for web scraping and browser profiles.

How it handles HTTP and HTTPS

Plain HTTP. The client sends the full URL in the request line, for example GET http://example.com/page HTTP/1.1. The proxy connects to example.com, forwards the request and relays the response. Because nothing is encrypted, the proxy can read, cache, filter or modify both sides, and it can add headers like X-Forwarded-For.

HTTPS. The client sends CONNECT example.com:443 HTTP/1.1. The proxy opens a TCP connection to that host and replies 200 Connection Established. From then on it just passes bytes in both directions. Your client and the website negotiate TLS through that tunnel, so the proxy sees only the host name and the amount of data. See HTTP CONNECT.

Since nearly all websites use HTTPS today, most traffic through an HTTP proxy is actually tunnelled.

Authentication

When credentials are required, the proxy answers a request without them with 407 Proxy Authentication Required and a Proxy-Authenticate header. The client retries with Proxy-Authorization: Basic <base64 of user:pass>. Many providers also offer IP allowlisting instead. Because Basic credentials are only encoded, not encrypted, anyone on the path between you and the proxy could read them unless the connection to the proxy itself is encrypted. See proxy authentication.

HTTP proxy vs SOCKS5 proxy

HTTP proxySOCKS5
UnderstandsHTTPAny TCP (and UDP)
HTTPSVia CONNECT tunnelNative, protocol-agnostic
Can add or remove headersPlain HTTP onlyNever
UDPNoYes
Tool supportUniversalVery wide
Typical port8080, 3128, 80001080

For browsers and scraping, HTTP proxies are usually simplest. For email clients, games, SSH or custom protocols, choose SOCKS5.

Configuration examples

  • curl: curl -x http://user:[email protected]:8080 https://example.com
  • Python requests: proxies={"http": "http://user:pass@host:8080", "https": "http://user:pass@host:8080"}. Note the https key still uses an http:// proxy URL, because the connection to the proxy is plain HTTP that then tunnels.
  • Environment variables: HTTP_PROXY and HTTPS_PROXY are read by many command-line tools.

Common errors

ErrorLikely cause
407Wrong credentials or your IP is not allowlisted
403Target blocked the proxy IP
502 / 504Proxy could not reach the target or timed out
SSL errorsWrong proxy scheme (https:// used for an HTTP proxy) or TLS interception

More in HTTP status codes for proxies.

What an HTTP proxy request looks like on the wire

For a plain HTTP site, the client sends the full URL to the proxy instead of just the path:

GET http://example.com/page HTTP/1.1
Host: example.com
Proxy-Authorization: Basic dXNlcjpwYXNz

The proxy reads the URL, connects to example.com, sends a normal request and returns the answer. For HTTPS sites the client sends CONNECT example.com:443 instead and the proxy opens a raw tunnel, as described in HTTP CONNECT.

Caching and header changes

Classic HTTP proxies were built to cache. If many users requested the same file, the proxy stored it and served copies, saving bandwidth. Commercial proxy services usually switch caching off, because customers want fresh data from the target. Some HTTP proxies also add or strip headers such as Via or X-Forwarded-For on plain HTTP requests. Check what yours does with a header echo test, as explained under elite proxy.

Choosing between HTTP and SOCKS5 for a project

SituationBetter choice
Browser automation, scraping libraries, curlHTTP proxy (widest support)
Non-HTTP protocols such as SMTP, FTP or game trafficSOCKS5
UDP trafficSOCKS5 with UDP support
Tools that only accept one proxy typeWhatever the tool supports

Most commercial residential and ISP providers offer both on different ports with the same credentials, so you can switch without buying anything new.

Frequently asked questions

Can an HTTP proxy handle HTTPS websites?

Yes. It uses the CONNECT method to open an encrypted tunnel, so HTTPS content stays private between you and the website.

What is the difference between an HTTP and an HTTPS proxy?

Providers often use the terms interchangeably for an HTTP proxy that supports CONNECT. Strictly, an HTTPS proxy is one you connect to over TLS, which also encrypts your credentials and target host from your local network.

Which port do HTTP proxies use?

There is no fixed port. 8080, 3128 and 8000 are common, and providers often use their own ranges.

Is an HTTP proxy secure?

The content of HTTPS sites is protected by TLS end to end. The connection to the proxy itself, including Basic authentication, is not encrypted unless you use a TLS-enabled proxy.

Why does my HTTP proxy work in curl but not in my browser?

Browsers handle proxy passwords through a pop-up or extension, and some ignore credentials embedded in the proxy address. Try IP allowlisting, a browser profile manager that supports authenticated proxies, or a local forwarder.

Sources and further reading

Browse all 40 glossary terms Markdown version