Monday, 10 March 2014

HTTP Method - CONNECT

🚀 Master web protocols and backend networking fundamentals!

🔔 Subscribe to Ram N Java on YouTube

What Is the HTTP CONNECT Method?

In web networking, communication occurs between a client (such as your browser) and a web server (the host running the website).

The HTTP CONNECT method is a specialized request used to start two-way communications with the requested resource. Specifically, it allows a client to establish an end-to-end network tunnel to a destination server through an intermediate proxy or firewall machine over HTTP.

How HTTP Tunneling Works

When your client wants to access a secure destination through a proxy server:

  • The client sends an HTTP CONNECT request specifying the host and port of the desired destination.
  • The proxy server sets up a direct TCP connection to that target on the client's behalf.
  • Once established, the proxy simply blind-relays data back and forth, enabling encrypted SSL/TLS (HTTPS) traffic without intercepting the content.

Sample HTTP CONNECT Request & Response

Here is an example showing the structure of an HTTP CONNECT request:

CONNECT www.ramnjava.blogspot.com:443 HTTP/1.1
Host: www.ramnjava.blogspot.com:443
User-Agent: Mozilla/5.0

When the proxy or gateway server successfully connects to the remote host, it returns a response with the status code 200 Connection established:

HTTP/1.1 200 Connection established
Proxy-Agent: Apache/2.2.14

After this status response is received, the tunnel is active, and direct data exchange begins immediately between the client and server.

Related Tutorials You Might Enjoy


Click here to watch in Youtube : https://www.youtube.com/watch?v=B0dRnG0GWJg

Click the below Image to Enlarge
HTTP Method - CONNECT

HTTP Method - CONNECT

See also:

  • Servlets Tutorial
  • All Design Patterns Links
  • No comments:

    Post a Comment

    Tutorials