Contents
Explainers

What Is a Proxy? Forward, Reverse and SOCKS5

A proxy is a middleman that forwards network requests for you. Learn the difference between forward and reverse proxies, which layer HTTP and SOCKS5 proxies work at, what a proxy can and can't see — with three sequence diagrams of how they work.

Last updated:

A proxy is a middleman that forwards network requests for you: instead of contacting a site directly, you hand your request to the proxy, it contacts the site, and it passes the result back. Proxies come in two kinds depending on who they work for: a forward proxy works for users (a company’s internet gateway, for example), and a reverse proxy works for websites (CDNs, Nginx). The common proxy protocols — HTTP proxies and SOCKS5 — don’t encrypt anything on their own, which is one of the biggest differences between a proxy and a VPN.

Illustration: on the left a courier stands on the users' side carrying their requests out to many websites; on the right a receptionist stands on the servers' side, greeting visitors and sending each to a server
  1. ① UsersHand their requests to the forward proxy
  2. ② Forward proxyGoes out to websites on the users' behalf
  3. ③ WebsitesSee only the proxy, not the users behind it
  4. ④ VisitorsThink they're talking to the website directly
  5. ⑤ Reverse proxyGreets, routes and caches in front of the site
  6. ⑥ Origin serversThe real servers, hidden behind the proxy

What a proxy really is: a middleman

Without a proxy, your device talks to the website directly. With one, the conversation is split in two:

  1. You ↔ proxy: you tell the proxy which site you want;
  2. Proxy ↔ website: the proxy visits the site as itself, so the site sees the proxy’s IP address, not yours.

Sitting in the middle lets a proxy do a lot — cache popular content, filter access, hide one side’s identity, spread traffic across servers. It also means it can see everything unencrypted that passes through it.

Forward vs reverse proxies

The technology is the same; what differs is which side the proxy stands on and who it serves:

Forward proxyReverse proxy
Works forUsers (clients)Websites (servers)
Who knows it’s thereUsers configure it themselvesUsers usually don’t — they think they’re talking to the site
HidesThe user: sites only see the proxy’s IPThe server: visitors only see the proxy, not the origin behind it
Typical usesCompany or school internet gateways, access control, cachingCDNs, load balancing, attack protection, central HTTPS certificates
Everyday exampleThe proxy address your office network tells you to enterAlmost every large site you visit goes through a CDN first

How does a forward proxy handle HTTPS?

Nearly every site uses HTTPS now, so the content is encrypted and the proxy can’t — and doesn’t need to — read it. The browser first uses the CONNECT method to have the proxy open a channel, then the proxy relays the encrypted data untouched:

Browser Proxy server Website CONNECT example.com:443 1 Opens TCP connection 2 200 Connection established 3 TLS handshake (relayed as-is) 4 Encrypted HTTP request 5 Encrypted page 6
Thick lines are encrypted. The proxy sees the domain and port you connect to, but not the encrypted content.
StepWhat’s happening
① CONNECTThe browser asks the proxy to connect it to port 443 on example.com
② ConnectThe proxy opens a TCP connection to the site as itself
③ 200The proxy replies “Connection established” — the channel is open
④ TLS handshakeThe browser does the TLS handshake directly with the site; the proxy just carries the bytes
⑤–⑥ Encrypted dataRequests and pages from here on are encrypted; the proxy can’t read them, only forward them

So for HTTPS sites, a forward proxy can see which domain you visited, when, and how much data moved — but not the content. For a plain HTTP site, it sees everything and could even change it.

Reverse proxies: the front desk for a website

When you visit a big website, the machine that greets you usually isn’t the real server (the origin) but a reverse proxy or CDN node standing in front of it:

Visitor Reverse proxy / CDN Origin CACHE HIT GET /logo.png 1 Cached — serve it 2 logo.png 3 CACHE MISS GET /news 4 Not cached 5 Forward to origin 6 Builds the page 7 Cache a copy 8 Return the page 9
Visitors only ever talk to the reverse proxy — they never see the origin server behind it.
StepWhat’s happening
①–③ Cache hitFor things that rarely change, like images and stylesheets, the reverse proxy already has a copy and returns it — the origin isn’t involved at all
④–⑤ Cache missThe request is for something not in the cache
⑥–⑦ Go to originThe reverse proxy forwards the request to the origin, which builds the page and returns it
⑧ CacheThe proxy stores a copy according to the site’s rules, so the next visitor gets it straight away
⑨ ReturnThe page goes back to the visitor

The payoff: visitors get data from a nearby node, so it’s faster; the origin does far less work; and its real address stays hidden, making it harder to attack.

HTTP vs SOCKS5 proxies: which layer they work at

HTTP proxySOCKS5 proxy
LayerApplication — it understands HTTPSession (between application and transport) — doesn’t care what protocol runs on top
What it can forwardMostly web traffic (HTTP, plus HTTPS via CONNECT)Any TCP connection, plus UDP — email, games, chat apps
EncryptionNoneNone
AuthenticationOptional username and passwordOptional username and password

SOCKS5 is simple: say hello, authenticate, tell the proxy where to connect, and from then on it just relays:

Application SOCKS5 proxy Target server GREETING AND AUTH Hello: auth methods I support 1 Use username/password 2 Username + password 3 Authenticated 4 CONNECT REQUEST CONNECT host:port 5 Opens TCP connection 6 Succeeded 7 RELAY From now on the proxy relays data as-is 8
SOCKS5 doesn't encrypt anything: once the handshake is done, the proxy just relays data between the two sides.
StepWhat’s happening
①–② GreetingThe program lists the authentication methods it supports; the proxy picks one
③–④ AuthenticationThe program sends a username and password and the proxy checks them. Note: this is sent in plain text too
⑤ Connect requestThe program gives the proxy the target address and port
⑥–⑦ ConnectThe proxy connects to the target and reports success
⑧ RelayFrom now on the proxy forwards data both ways as-is — no parsing, no encryption

What a proxy can and can’t do

It can:

  • Hide your IP address — sites see the proxy’s address;
  • Centralise control — a company can filter and audit staff browsing in one place;
  • Speed things up with caching — popular content is served from the proxy;
  • Share the load — a reverse proxy spreads visitors across many servers.

It can’t:

  • Keep your activity private from the proxy itself — the proxy doesn’t encrypt anything, so unencrypted content is fully visible, and even with HTTPS it sees which domains you visit;
  • Stop eavesdropping on the way to the proxy — with a plain HTTP or SOCKS5 proxy, anyone on your network, or your ISP, can see where you’re connecting and even your proxy password;
  • Cover your whole device — only programs configured to use the proxy go through it; everything else connects directly.

Those last two are exactly what a VPN solves: it encrypts the entire path between you and the server, and uses a virtual network adapter to capture all of your device’s traffic. The next article covers how.

FAQ

I set a proxy in my browser — why do some apps ignore it?

System and browser proxy settings only apply to programs that choose to honour them. Many command-line tools, games and some apps connect directly without reading those settings. To send all of a device's traffic through, you need a virtual network adapter (TUN) — see "What is a VPN?".

Are free public proxies OK to use?

Not for logging in to anything or handling sensitive data. A proxy sits between you and the site and can read anything unencrypted, and an unknown free proxy may log or even tamper with your traffic.

How does a CDN relate to proxies?

A CDN is essentially a huge fleet of reverse proxies around the world. They stand in front of a website, receive visitors on its behalf and cache content, so each visitor is served from a nearby location.

Don't have Pangolin yet?

Available for iPhone / iPad, Mac, Windows and Android. New accounts get a free 7-day Pro trial.

Download the app
← All posts