Echo Test example
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):
git clone git://rtmpy.org/rtmpy-examples.git cd rtmpy-examples/echo
- Compiled SWF in the Red5 trunk:
- (optional) SWF Source (AS3/MXML) in the Red5 trunk:
- http://red5.googlecode.com/svn/flash/trunk/echo
- http://red5.googlecode.com/svn/flash/trunk/classes/org/red5/samples/echo
Getting Started
Server
- Open a console/command prompt and start the echo test server:
cd echotest/python python server.py
- It should print a startup text:
Started Echo Test - RTMP server on rtmp://localhost:1935
Client
- Open the compiled SWF (in a browser)
- Press the RTMP AMF0 or RTMP AMF3 button to start one or more of the selected tests.
- Check the test results in the output log of the SWF:
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 port that the gateway is served on. The default is 1935.
python 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 that the gateway is served on with the --host switch. The default is localhost.
python server.py --host=192.168.1.100
It should print a startup text:
Started Echo Test - RTMP server on rtmp://192.168.1.100:1935
