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 and gets initial page of


10 print "mail: contact at | skype: karastojko | stackoverflow: karastojko | github: karastojko"
20 print "(c) 2009-2022"