File: rtmpt-specification.html

package info (click to toggle)
red5 1.0~svn4374-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 11,456 kB
  • sloc: java: 56,478; xml: 13,069; sh: 593; makefile: 33; jsp: 24
file content (35 lines) | stat: -rw-r--r-- 7,293 bytes parent folder | download
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
32
33
34
35
<html><head>
      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
   <title>Appendix&nbsp;B.&nbsp;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="rtmp-specification.html" title="Appendix&nbsp;A.&nbsp;RTMP Specification"><link rel="next" href="amf-specification.html" title="Appendix&nbsp;C.&nbsp;AMF Specification"></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-specification"></a>Appendix&nbsp;B.&nbsp;RTMPT Specification</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 class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e4990"></a>B.1.&nbsp;URLs</h2></div></div></div><p>The URL to be opened has the following form::</p><div class="blockquote"><blockquote class="blockquote"><p>  
				<a class="link" href="http://server/" target="_top">http://server/</a>&lt;comand&gt;/[&lt;client&gt;/]&lt;index&gt;
			</p></blockquote></div><p>
			<code class="literal">&lt;command&gt;</code>
		</p><div class="blockquote"><blockquote class="blockquote"><p>denotes the RTMPT request type (see below)</p></blockquote></div><p>
			<code class="literal">&lt;client&gt;</code>
		</p><div class="blockquote"><blockquote class="blockquote"><p>specifies the id of the client that performs the requests (only sent for
				established sessions)</p></blockquote></div><p>
			<code class="literal">&lt;index&gt;</code>
		</p><div class="blockquote"><blockquote class="blockquote"><p>is a consecutive number that seems to be used to detect missing packages</p></blockquote></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e5025"></a>B.2.&nbsp;Request / Response</h2></div></div></div><p>All HTTP requests share some common properties:</p><div class="itemizedlist"><ul type="disc"><li><p>They use HTTP 1.1 POST.</p></li><li><p>The content type is 
					<code class="literal">application/x-fcs</code>.
				</p></li><li><p>The connection should be kept alive by the client and server to reduce</p></li></ul></div><div class="blockquote"><blockquote class="blockquote"><p>  network overhead.</p></blockquote></div><p>The HTTP responses also share some properties:</p><div class="itemizedlist"><ul type="disc"><li><p>The content type is 
					<code class="literal">application/x-fcs</code>.
				</p></li><li><p>For all established sessions the first byte of the response data controls</p></li></ul></div><div class="blockquote"><blockquote class="blockquote"><p>  the polling interval of the client where higher values mean less polling
				  requests.</p></blockquote></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e5061"></a>B.3.&nbsp;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="d0e5068"></a>B.4.&nbsp;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="d0e5075"></a>B.5.&nbsp;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="d0e5082"></a>B.6.&nbsp;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="d0e5087"></a>B.7.&nbsp;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="rtmp-specification.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="amf-specification.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Appendix&nbsp;A.&nbsp;RTMP Specification&nbsp;</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">&nbsp;Appendix&nbsp;C.&nbsp;AMF Specification</td></tr></table></div></body></html>