4.2 HTTP KeepAlive Encapsulation Examples
HTTP KeepAlive encapsulation client creates a full duplex virtual connection that consists of two individual TCP connections. In the following examples, the connections to the server are named GET and POST. The POST connection is used to send data to the server; the GET connection is used to request data from the server. The following figure shows how the KeepAlive encapsulation connection is established.
Figure 24: KeepAlive Encapsulation connection establishment
The following are the messages exchanged to initialize a KeepAlive connection:
KeepAlive-GET-Request:
-
----------------------------------Message START ---------------------------------- GET /2.0/server.domain.net/kicxp8rrgwqdwhf7c6xsgbagmcdnxm9phtvbj5a,ConnType=KeepAlive HTTP/1.0 Accept: */* Content-Type: application/octet-stream User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Win32) Host: 10.150.1.226 Pragma: no-cache Cache-Control: no-cache Expires: 0 Connection: Keep-Alive Cache-Control: max-age=0 ----------------------------------Message END ------------------------------------
KeepAlive-POST-Request:
-
----------------------------------Message START ---------------------------------- POST /2.0/server.domain.net/kicxp8rrgwqdwhf7c6xsgbagmcdnxm9phtvbj5a,ConnType=KeepAlive HTTP/1.0 Accept: */* Content-Type: application/octet-stream User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Win32) UserAgent: server.domain.net Connection: Keep-Alive Content-Length: 22 Pragma: no-cache Cache-Control: no-cache Expires: 0 Cache-Control: max-age=0 GroovePing: 1.0,Ping ----------------------------------Message END ------------------------------------
KeepAlive-POST-Response:
-
----------------------------------Message START ---------------------------------- HTTP/1.0 200 OK Date: Wed, 26 Dec 2007 19:50:26 GMT Server: Groove-Relay/12.0 Connection: Keep-Alive Content-Length: 15 <HTML></HTML> ----------------------------------Message END ------------------------------------
KeepAlive-GET-Response:
-
----------------------------------Message START ---------------------------------- HTTP/1.0 200 OK Date: Wed, 26 Dec 2007 19:50:26 GMT Server: Groove-Relay/12.0 Connection: Keep-Alive Content-Length: 22 GroovePing: 1.0,Ping ----------------------------------Message END ------------------------------------
For a KeepAlive connection, each request results in a response from the server. The HTTP return codes of 200 on both responses indicates the successful creation of both HTTP connections. The GroovePing message is sent on the POST Request and received on the GET Response to complete the establishment of the virtual KeepAlive connection.
-
-
The following figure shows the message flow that is used to send and receive application data between protocol client and protocol server.
-
Figure 25: HTTP KeepAlive Encapsulation application data exchange
The following are examples of the messages that are exchanged to send and receive application data between the client and server.
KeepAlive-GET-Request:
-
----------------------------------Message START ---------------------------------- GET /2.0/server.domain.net/kicxp8rrgwqdwhf7c6xsgbagmcdnxm9phtvbj5a,ConnType=KeepAlive HTTP/1.0 Accept: */* Content-Type: application/octet-stream User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Win32) Host: 10.150.1.226 Pragma: no-cache Cache-Control: no-cache Expires: 0 Connection: Keep-Alive Cache-Control: max-age=0 ----------------------------------Message END ------------------------------------
KeepAlive-POST-Request:
-
----------------------------------Message START ---------------------------------- POST /2.0/server.domain.net/kicxp8rrgwqdwhf7c6xsgbagmcdnxm9phtvbj5a,ConnType=KeepAlive HTTP/1.0 Accept: */* Content-Type: application/octet-stream User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Win32) UserAgent: server.domain.net Connection: Keep-Alive Content-Length: 188 Pragma: no-cache Cache-Control: no-cache Expires: 0 Cache-Control: max-age=0 Application-Data ----------------------------------Message END ------------------------------------
KeepAlive-GET-Response:
-
----------------------------------Message START ---------------------------------- HTTP/1.0 200 OK Date: Wed, 26 Dec 2007 19:50:26 GMT Server: Groove-Relay/12.0 Connection: Keep-Alive Content-Length: 169 Application-Data ----------------------------------Message END ------------------------------------
KeepAlive-POST-Response:
-
----------------------------------Message START ---------------------------------- HTTP/1.0 200 OK Date: Wed, 26 Dec 2007 19:50:26 GMT Server: Groove-Relay/12.0 Connection: Keep-Alive Content-Length: 0 ----------------------------------Message END ------------------------------------
KeepAlive-GET-Request:
-
----------------------------------Message START ---------------------------------- GET /2.0/server.domain.net/g5u55h8rrgwqdwhf7c6xsgbagmcdnxm9pht2kop41a,ConnType=KeepAlive HTTP/1.0 Accept: */* Content-Type: application/octet-stream User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Win32) Host: 10.150.1.226 Pragma: no-cache Cache-Control: no-cache Expires: 0 Connection: Keep-Alive Cache-Control: max-age=0 ----------------------------------Message END ------------------------------------