What it means
A proxy receives a request, then makes a new connection of its own to carry it onward. The far side sees the proxy, not the original sender. A forward proxy serves the devices inside an organization: it gives their web traffic one way out, where policy can be applied and a log kept. A reverse proxy sits in front of servers, where it can end TLS, share load, and hide the servers behind it.
What a proxy can read depends on encryption. For plain HTTP it reads the whole request. For HTTPS through a CONNECT tunnel it sees the host and port and copies encrypted bytes. To read the page it must end the TLS session itself, which only works on devices that trust its certificate authority.
See the idea / Networks
Through a CONNECT tunnel, a proxy sees the host, not the page.
A laptop reaches an HTTPS site through the station's forward proxy. Watch what the proxy learns at each step.
Station bench. A forward proxy at 10.6.0.8, port 8080, makes web connections for office devices, and a firewall rule makes it the only way out. A laptop wants a page on https://docs.example.com. The proxy allows tunnels only to port 443. TLS is the protocol that encrypts the page in transit. This proxy does not decrypt it.
01 / 04
CONNECT
The laptop asks the proxy to open a tunnel: CONNECT docs.example.com:443. The target names only a host and a port.
More about this step
For an HTTPS address, the laptop does not send the full address to the proxy. The CONNECT request target carries only the host and the port. The path of the page stays on the laptop for now.
Step through at your own pace.
Keep in mindThis is a plain tunnel. A proxy that ends TLS itself, with a certificate from a CA the device trusts, can read the whole request. That is TLS interception and it is not shown. The proxy still logs the host and port. Plain HTTP requests, proxy sign-in and reverse proxies are also not shown. With Encrypted Client Hello, the proxy cannot read the server name either.
Read the visual, step by step
- CONNECT. The laptop asks the proxy to open a tunnel: CONNECT docs.example.com:443. The target names only a host and a port. For an HTTPS address, the laptop does not send the full address to the proxy. The CONNECT request target carries only the host and the port. The path of the page stays on the laptop for now.
- Policy. The proxy checks the host and port against its policy. Port 443 is allowed, so it goes on. This proxy, at 10.6.0.8 port 8080, allows tunnels only to port 443. The HTTP standard advises proxies to limit CONNECT to known ports. Without that limit, someone could use the proxy to reach mail or administration ports. A host on a block list would be refused here, and no connection to the site would be opened.
- Tunnel. The proxy opens its own connection to the site and answers the laptop with status 200. The tunnel is open. There are now two connections: laptop to proxy, and proxy to site. The site sees a connection from the station, not from the laptop. Any 2xx status tells the laptop that the proxy has switched to copying bytes.
- TLS inside. The laptop does TLS with the site through the tunnel. The proxy copies the bytes. It can often read the server name, but not the path or the page. TLS, the protocol that encrypts the page in transit, starts with a message that usually carries the server name in clear text, so the proxy can often read it. Everything after the handshake is encrypted between the laptop and the site. The proxy forwards those records without reading them. Its log holds the host, the port and the time.
This is a plain tunnel. A proxy that ends TLS itself, with a certificate from a CA the device trusts, can read the whole request. That is TLS interception and it is not shown. The proxy still logs the host and port. Plain HTTP requests, proxy sign-in and reverse proxies are also not shown. With Encrypted Client Hello, the proxy cannot read the server name either.
Flow references: RFC 9110: the CONNECT method · RFC 8446: TLS 1.3
AN ILLUSTRATIVE SCENARIO
A school district web filter
A school district sends student web traffic through a forward proxy. Staff expect it to block harmful pages, but most sites use HTTPS and the proxy sees only host names. It can block a whole site and cannot block one page on an allowed site. The district decides to decrypt traffic on school-owned laptops, where it can install its own certificate authority. It keeps a list of health and banking sites that are never decrypted.
Put it to work
- Decide what the proxy is for: filtering, logging, caching, or protecting servers. Each purpose needs different visibility.
- Make the proxy the only way out with a firewall rule. Otherwise devices can simply connect around it.
- If you decrypt traffic, say so in policy, exempt sensitive categories, and confirm the proxy rejects bad certificates on behalf of its users.
How to check your work
Request a blocked host and an allowed host and compare the proxy log with what you expected it to see. From a device set to connect directly, confirm the firewall refuses the attempt.
Connect the ideas
- Firewall
A device or program that sits between networks and allows or blocks traffic according to an ordered set of rules.
- TLS
A protocol that encrypts and integrity-protects an application conversation and checks a certificate for a name.
- WAF
A control that inspects web application traffic and applies rules to detect or block unwanted requests, often including known attack patterns.
- HTTP
The application protocol that names methods, paths, headers, and bodies for web requests.