1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Appendix A. RTMPT Specification</title><link rel="stylesheet" href="html.css" type="text/css"><meta name="generator" content="DocBook XSL-NS Stylesheets V1.74.0"><link rel="home" href="index.html" title="Red5 - Reference Documentation"><link rel="up" href="index.html" title="Red5 - Reference Documentation"><link rel="prev" href="TestingRed5.html" title="Chapter 19. Testing Red5"><link rel="next" href="changelog.html" title="Appendix B. Changelog"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div xmlns="http://www.w3.org/TR/xhtml1/transitional" style="background-color:white;border:none;height:73px;border:1px solid black;"><a style="border:none;" href="http://osflash.org/red5" title="Red5 Open Source Flash Server"><img style="border:none;" src="images/red5-banner.png"></img></a><a style="border:none;" href="http://osflash.org/red5" title="Red5 Open Source Flash Server"><img style="border:none;position:absolute;padding-top:5px;right:42px;" src="images/red5-banner-logo.png"></img></a></div><div class="appendix" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="rtmpt"></a>Appendix A. RTMPT Specification</h2></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="rtmpt-spec-overview"></a>A.1. Overview</h2></div></div></div><p>This document describes the RTMPT tunneling protocol as implemented by the
Red5 Open Source Flash Server. Please note that this document is _not_ an
official specification by Macromedia but hopefully helps other people to
write software that makes use of RTMPT.</p><p>RTMPT basically is a HTTP wrapper around the RTMP protocol that is sent using
POST requests from the client to the server. Because of the non-persistent
nature of HTTP connections, RTMPT requires the clients to poll for updates
periodically in order to get notified about events that are generated by the
server or other clients.</p><p>During the lifetime of a RTMPT session, four possible request types can be
sent to the server which will be described below.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="rtmpt-spec-urls"></a>A.2. URLs</h2></div></div></div><p>The URL to be opened has the following form:</p><pre class="programlisting">http://server/<b class="hl-tag" style="color: blue"><comand></b>/[<b class="hl-tag" style="color: blue"><client></b>/]<b class="hl-tag" style="color: blue"><index></b></pre><div class="variablelist"><dl><dt><span class="term">
<em class="citetitle"><command></em>
</span></dt><dd><p>denotes the RTMPT request type (see below)</p></dd><dt><span class="term">
<em class="citetitle"><client></em>
</span></dt><dd><p>specifies the id of the client that performs the requests (only sent for
established sessions)</p></dd><dt><span class="term">
<em class="citetitle"><index></em>
</span></dt><dd><p>is a consecutive number that seems to be used to detect missing packages</p></dd></dl></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="rtmpt-spec-request-response"></a>A.3. Request / Response</h2></div></div></div><p>All HTTP requests share some common properties:</p><div class="blockquote"><blockquote class="blockquote"><div class="itemizedlist"><ul type="-"><li style="list-style-type: -"><p>They use HTTP 1.1 POST.</p></li><li style="list-style-type: -"><p>The content type is <em class="citetitle">application/x-fcs</em>.</p></li><li style="list-style-type: -"><p>The connection should be kept alive by the client and server to reduce
network overhead.</p></li></ul></div></blockquote></div><p>The HTTP responses also share some properties:</p><div class="blockquote"><blockquote class="blockquote"><div class="itemizedlist"><ul type="-"><li style="list-style-type: -"><p>The content type is <em class="citetitle">application/x-fcs</em>.</p></li><li style="list-style-type: -"><p>For all established sessions the first byte of the response data controls
the polling interval of the client where higher values mean less polling
requests.</p></li></ul></div></blockquote></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="rtmpt-spec-polling-interval"></a>A.4. Polling interval</h2></div></div></div><p>The server always starts with a value of 0x01 after data was returned and
increases it after 10 emtpy replies. The maximum delay is 0x21 which causes
a delay of approximately 0.5 seconds between two requests.</p><p>Red5 currently increases the delay in the following steps:
0x01, 0x03, 0x05, 0x09, 0x11, 0x21.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="rtmpt-spec-initial-connect-command-open"></a>A.5. Initial connect (command "open")</h2></div></div></div><p>This is the first request that is sent to the server in order to register a
client on the server and start a new session. The server replies with a unique
id (usually a number) that is used by the client for all future requests.</p><p>Note: the reply doesn't contain a value for the polling interval!
A successful connect resets the consecutive index that is used in the URLs.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="rtmpt-spec-client-updates-command-send"></a>A.6. Client updates (command "send")</h2></div></div></div><p>The data a client would send to the server using RTMP is simply prefixed with
a HTTP header and otherwise sent unmodified.</p><p>The server responds with a HTTP response containing one byte controlling the
polling interval and the RTMP data if available.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="rtmpt-spec-polling-requests-command-idle"></a>A.7. Polling requests (command "idle")</h2></div></div></div><p>If the client doesn't have more data to send to the server, he has to poll
for updates to receive streaming data or events like shared objects.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="rtmpt-spec-disconnect-of-a-session-command-close"></a>A.8. Disconnect of a session (command "close")</h2></div></div></div><p>If a client wants to terminate his connection, he sends the "close" command
which is replied with a 0x00 by the server.</p></div></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="TestingRed5.html">Prev</a> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right"> <a accesskey="n" href="changelog.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 19. Testing Red5 </td><td width="20%" align="center"><span style="color:white;font-size:90%;"><a href="http://osflash.org/red5" title="Red5">Red5 Open Source Flash Server</a></span></td><td width="40%" align="right" valign="top"> Appendix B. Changelog</td></tr></table></div></body></html>
|