I'm currently running OpenVPN and a squid proxy on a small VPS. In the config file of the VPN I'm using OpenVPN proxy options to connect to the proxy before the VPN.
The interesting part of the configuration is like this:
*Note: the redacted IP in the config file is the same as both squid and OpenVPN server are on the same VPS.
[...]
remote xxx.xxx.xxx.xxx 15855 tcp-client
http-proxy xxx.xxx.xxx.xxx 3128
[...]
http-proxy-option CUSTOM-HEADER Host [redacted]
[...]
I understand that the proxy is located before the VP connection, but squid being an HTTP proxy how can it handle the TCP connection to the VPN? When the custom header is passed? It's passed when the client connects to the proxy or when from the proxy the packets go to the VPN?
Can anybody explain it or point me to some reference to better understand what's happening?