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

  1. The EchoTest example for RTMPy (browse online):
    svn co http://svn.rtmpy.org/examples/trunk/echo echotest
    
  1. Compiled SWF in the Red5 trunk:
  1. (optional) SWF Source (AS3/MXML) in the Red5 trunk:

Getting Started

  1. Open a console/command prompt and run the echo test server by running:
    python echotest/server.py
    
  2. It should print a startup text:
    Started Echo Test - RTMP Server on rtmp://localhost:1935
    
  3. Open the compiled SWF (in a browser).
  4. 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