<s> from twisted . internet import reactor <EOL> from autobahn . websocket import WebSocketServerFactory , WebSocketServerProtocol , listenWS <EOL> class EchoServerProtocol ( WebSocketServerProtocol ) : <EOL> def onMessage ( self , message , binary ) : <EOL> self . sendMessage ( message , binary ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> factory = WebSocketServerFactory ( "<STR_LIT>" ) <EOL> factory . protocol = EchoServerProtocol <EOL> listenWS ( factory ) <EOL> reactor . run ( ) </s>
