Echo Test example
Content
The echo test example allows you to echo data from the Flash Player to a Twisted server, and verify in the client if the returned data is valid and the same as the original data.
Download
- The EchoTest example for RTMPy (browse online):
svn co http://svn.rtmpy.org/examples/trunk/echo echotest
- Compiled SWF in the Red5 trunk:
- (optional) SWF Source (AS3/MXML) in the Red5 trunk:
- http://svn1.cvsdude.com/osflash/red5/java/server/trunk/swf/DEV_Source/echo
- http://svn1.cvsdude.com/osflash/red5/java/server/trunk/swf/DEV_Source/classes/org/red5/samples/echo
Getting Started
- Open a console/command prompt and run the echo test server by running:
python echotest/server.py
- It should print a startup text:
Started Echo Test - RTMP Server on rtmp://localhost:1935
- Open the compiled SWF (in a browser).
- Press the RTMP AMF0 or RTMP AMF3 button to start one or more of the selected tests.
The output log in the SWF should show the test results:
Connecting through RTMP using AMF0 encoding... Testing null: OK (in 0.118 sec). Result: (null) Testing undefined: OK (in 0.025 sec). Result: (null) Testing true: OK (in 0.049 sec). Result: (true) Testing false: OK (in 0.05 sec). Result: (false) Testing : OK (in 0.05 sec). Result: (String with 0 chars) Testing Hello world!: OK (in 0.052 sec). Result: (Hello world!) Testing test1,test2,test3,test4: OK (in 0.051 sec). Result: (test1,test2,test3,test4) Testing String with 40000 chars: OK (in 0.048 sec). Result: (String with 40000 chars) Testing String with 70000 chars: OK (in 0.063 sec). Result: (String with 70000 chars) Testing String with 1000000 chars: OK (in 0.2 sec). Result: (String with 1000000 chars) Testing 0: OK (in 0.031 sec). Result: (0) Testing 1: OK (in 0.042 sec). Result: (1) Testing -1: OK (in 0.042 sec). Result: (-1) Testing 256: OK (in 0.053 sec). Result: (256) Testing -256: OK (in 0.045 sec). Result: (-256) Testing 65536: OK (in 0.052 sec). Result: (65536) Testing -65536: OK (in 0.05 sec). Result: (-65536) etc....
Options
Port
You can change the server port with the --port switch. The default is 1935.
python examples/echo/server.py --port=4444
It should print a startup text:
Started Echo Test - RTMP Server on rtmp://localhost:4444
Host
You can change the host address of the server with the --host switch. The default is localhost.
Started Echo Test - RTMP Server --host=192.168.1.100
It should print a startup text:
Started Echo Test - RTMP Server on rtmp://192.168.1.100:1935
