Chris Pollett >
Students > [Bio] [Blog] |
Deliverable 4 - HTTP/2 DetectionDescription: Implementing a PHP program which attempts to connect to a server and fetches the protocol that gets negotiated by both client and server to be used for their further communication. Step - 1: Creating a socket for communicationIn this step, a TCP/IP socket is created using PHP's socket functions to establish communication between the client and the server. Step - 2: Connecting to the serverOnce the socket is created, connection can be attempted to the server using the socket_connect() function in PHP. This step either establishes the connection between the client and the server, or displays the error in connecting to the server. Step - 3: Fetching the negotiated protocolAfter successfully connecting to the server, the negotiated protocol is extracted from the handshake protocol packets exchanged between the client and the server. This involves sending a request to the server and capturing the protocol information exchanged during the handshake process. ResultsFind the full code below:DetectingH2.php.zip |