Sub topic 7
Explicit and transparent proxy deployments
This chapter assumes you know how a forward proxy relays HTTP and what the CONNECT method does. A forward proxy can reach clients in two ways. Clients can be configured to use it, which is an explicit deployment. Or the network can send their traffic to it without their knowledge, which is a transparent deployment. The choice affects what the proxy can see, what breaks, and how much configuration you maintain.
Explicit proxies
With an explicit proxy, the client knows the proxy exists. You set it in the browser, the operating system, an environment variable, or a tool flag. The client then sends its requests to the proxy address instead of to the destination.
curl -x http://proxy.internal:3128 https://example.org/For an HTTPS URL, the client first asks the proxy to open a tunnel:
CONNECT example.org:443 HTTP/1.1
Host: example.org:443
HTTP/1.1 200 Connection establishedThe proxy sees the destination host and port from the CONNECT line. It does not see the encrypted content that follows. Because the client chose to talk to the proxy, it can also answer proxy authentication challenges (status 407), so you can identify users.
Transparent proxies
With a transparent proxy, which is also called an intercepting proxy, the client is not configured at all. A router or firewall on the network path redirects outbound traffic, usually port 80, to the proxy. The client believes it is talking directly to the origin server.
A common Linux setup redirects port 80 with a firewall rule and tells Squid to accept redirected connections:
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-ports 3129http_port 3129 interceptThe proxy recovers the intended destination from the connection's original address and from the Host header. Use a separate port for intercepted traffic. A port that accepts intercepted connections cannot serve explicit clients at the same time.
What changes for HTTPS
A transparent proxy receives a raw TLS handshake, not a CONNECT request. It can read only what the handshake exposes, mainly the server name in the SNI field. It cannot read paths, headers, or bodies.
To inspect or cache HTTPS content, the proxy must terminate TLS itself. It presents certificates signed by a private certificate authority (CA), and every client must trust that CA. This is TLS interception. It requires managed devices, and it breaks certificate pinning in some applications.
Choosing between them
| Aspect | Explicit | Transparent |
|---|---|---|
| Client configuration | Required | None |
| Client awareness | Knows about the proxy | Unaware |
| HTTPS handling | CONNECT tunnel, destination visible | Handshake only, unless TLS is intercepted |
| User authentication | Natural, using 407 | Hard, because the client does not expect a challenge |
| Can be bypassed | Yes, by changing settings | Only if the network allows another path |
| Failure mode | Clear proxy error | Confusing timeouts or wrong content |
Common errors
- Redirect loop. The proxy's own outbound traffic matches the redirect rule. Exempt the proxy's address from the rule.
- Missing return path. Replies must come back through the proxy. Asymmetric routing makes connections hang.
- Host mismatch. A client that sets a Host header different from the destination IP can be used to bypass filtering. Squid checks for this on intercepted traffic.
- Unexplained blocking. Users cannot tell that a proxy blocked them. Show an explanation page and publish your policy.
Exercise
A company wants to filter outbound web traffic for laptops it manages, and needs per-user logs. Should it use an explicit or a transparent proxy, and why?
Show answer
Explicit. The laptops can be configured, and the proxy can send 407 challenges to identify users for the logs. A transparent proxy cannot easily authenticate users, and its HTTPS visibility is limited to the SNI unless TLS is intercepted.