1 from rtmpy
import server
3 from twisted
.internet
import reactor
6 class LiveApplication(server
.Application
):
8 The simplest application possible.
20 def onConnect(self
, client
, **args
):
22 client
.call("initial", [ "connection attempt received", args
])
26 def onConnectAccept(self
, client
, **args
):
27 print("Connection accepted", client
)
28 client
.call("welcome", [ "You have connected!", args
])
31 def onDownstreamBandwidth(self
, interval
, bandwidth
):
32 print("Downstream Bandwidth:", interval
, bandwidth
)
35 def echo(self
, *args
, **kw
):
36 print("echo", args
, kw
)
39 def onDisconnect(self
, client
):
40 # This is probably never actually sent.
41 client
.call("disconnected", "arg1");
45 app
= LiveApplication()
47 reactor
.listenTCP(9984, server
.ServerFactory({