HTTP proxy with sockets

Connecting to web means that TCP connection is created at (common) port 80. What happens if proxy is required? In that case, TCP socket connects to the proxy server and the HTTP Host header of the request must contain host name of the desired URL. Take a look at the following sample written in Java. It connects to proxy at 10.63.53.1:3128 and gets initial page of www.alepho.com.

ClientHttpProxy.java

ready.

10 print "mail: contact at alepho.com | skype: karastojko | stackoverflow: karastojko | github: karastojko"
20 print "(c) 2009-2023 www.alepho.com"