A typical HTTP transaction involves a client making a direct TCP/IP connection to a remote web server. In some situations a client may not be able to establish this connection due to the network topology or the presence of a network firewall. To solve this problem a client can use an HTTP proxy server as a gateway to communicate with a remote server. HTTP proxy servers are commonly found in corporate environments where employees are not permitted to access the Internet directly. Proxies are also used to improve Internet performance by caching frequently requested documents and returning cached versions to clients.
Figure 2.7 shows two HTTP transactions. The first transaction is a typical HTTP transaction with a web browser communicating directly with a remote web server. The second transaction shows how the transaction changes when a proxy server is used. All communication between the web browser and web server is performed by the proxy server. HTTP requests are also different when using a proxy server. Since the web browser is not talking directly to the web server, the web browser needs to tell the proxy server the complete URL to be requested. This is necessary since by default the HTTP GET command only includes the document path in the request, not the URL. If a proxy server were to only receive the document path, it would not know the address of the web server. Figure 2.8 shows an example HTTP request without and then with a proxy server.