RTP over HTTP - Request and Reply Requirements

The virtual full-duplex connection between client and server:

To work with the QuickTime HTTP transport, client HTTP requests must

In addition to these requirements, client HTTP POST request headers may include other directives in order to help HTTP proxy servers handle RTSP streams optimally.

Sample Client GET Request

Here is an example of a client GET request:

GET /live1.sdp HTTP/1.0
User-Agent: QuickTime/7.1.3 (qtver=7.1.3;os=Windows NT 5.1Service Pack 2)
x-sessioncookie: PPwTZeVfAAAul3YACIAAAA
Accept: application/x-rtsp-tunnelled
Pragma: no-cache
Cache-Control: no-cache
Sample Client POST Request

Here is an example of a client POST request:

POST /live1.sdp HTTP/1.0
User-Agent: QuickTime/7.1.3 (qtver=7.1.3;os=Windows NT 5.1Service Pack 2)
x-sessioncookie: PPwTZeVfAAAul3YACIAAAA
Content-Type: application/x-rtsp-tunnelled
Pragma: no-cache
Cache-Control: no-cache
Content-Length: 32767
Expires: Sun, 9 Jan 1972 00:00:00 GMT
Note: The server does not respond to client POST requests. The client will continue to send RTSP data as the message body of this POST request.

The sample client POST request includes three optional header directives that are present to control the behavior of HTTP proxy servers so that they handle RTSP streams optimally:

HTTP requires that all POST requests have a content-length header. In the sample client POST request, the content length of 32767 is an arbitrary value. In practice, the actual value seems to be ignored by proxy servers, so it is possible to send more than this amount of data in the form of RTSP requests. The QuickTime Server ignores the content-length header.

When the server receives an HTTP GET request from a client, it must respond with a reply whose header specifies the application/x-rtsp-tunneled MIME type for both the Content-Type and Accept directives.

Note: The server must reply to all client HTTP GET requests but never replies to client HTTP POST requests.

Server reply headers may optionally include the Cache-Control: no-store and Pragma: no-cache directives to prevent HTTP proxy servers from caching the transaction. It is recommended that implementations honor these headers if they are present.

Server clusters are often allocated connections by a round-robin DNS or other load-balancing algorithm. To insure that client requests are directed to the same server among potentially several servers in a server farm, the server may optionally include the x-server-ip-address directive followed by an IP address in dotted decimal format in the header of its reply to a clientˇ¦s initial GET request. When this directive is present, the client must direct its POST request to the specified IP address regardless of the IP address returned by a DNS lookup.

In the absence of an HTTP error, the server reply header contains "200 OK". An HTTP error in a server reply reflects the inability of the server to form the virtual full-duplex connection; an HTTP error does not imply an RTSP error. When an HTTP error occurs, the server simply closes the connection.

Sample Server Reply to a GET Request

Here is an example of a server reply to a GET request:

HTTP/1.0 200 OK
Content-Type: application/x-rtsp-tunnelled
Date: Tue, 21 Nov 2006 13:08:09 GMT
Server: Boa/0.94.14rc21
Accept-Ranges: bytes
Connection: close

Including the following header directives in a reply is not required but is recommended because the directives they tell proxy servers to behave in a way that allows them to handle RTSP streams optimally:

RTSP requests made by the client on the POST connection must be encoded using the base64 method. The base64 encoding prevents HTTP proxy server from determining that an embodied RTSP request is a malformed HTTP requests.

Here is a sample RTSP request before it is encoded:

DESCRIBE rtsp://192.168.2.121/live1.sdp RTSP/1.0
CSeq: 1
Accept: application/sdp
Bandwidth: 384000
Accept-Language: en-GB
User-Agent: QuickTime/7.1.3 (qtver=7.1.3;os=Windows NT 5.1Service Pack 2)

SETUP rtsp://192.168.2.121/live1.sdp/trackID=1 RTSP/1.0
CSeq: 2
Transport: RTP/AVP/TCP;unicast
x-dynamic-rate: 1
x-transport-options: late-tolerance=2.900000
User-Agent: QuickTime/7.1.3 (qtver=7.1.3;os=Windows NT 5.1Service Pack 2)
Accept-Language: en-GB

SETUP rtsp://192.168.2.121/live1.sdp/ RTSP/1.0
CSeq: 3
Transport: RTP/AVP/TCP;unicast
x-dynamic-rate: 1
x-transport-options: late-tolerance=2.900000
Session: 80673
User-Agent: QuickTime/7.1.3 (qtver=7.1.3;os=Windows NT 5.1Service Pack 2)
Accept-Language: en-GB

Here is the same request after encoding:

REVTQ1JJQkUgcnRzcDovLzE5Mi4xNjguMi4xMjEvbGl2ZTEuc2RwIFJUU1AvMS4w
DQpDU2VxOiAxDQpBY2NlcHQ6IGFwcGxpY2F0aW9uL3NkcA0KQmFuZHdpZHRoOiAz
ODQwMDANCkFjY2VwdC1MYW5ndWFnZTogZW4tR0INClVzZXItQWdlbnQ6IFF1aWNr
VGltZS83LjEuMyAocXR2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