def run_python3_asyncio(host="127.0.0.1", port=9009):
    """
    Runs a server using asyncio and Python 3.3+
    """
    import asyncio
    import wsaccel
    wsaccel.patch_ws4py()
    from ws4py.async_websocket import EchoWebSocket
    from ws4py.server.tulipserver import WebSocketProtocol
    
    loop = asyncio.get_event_loop()

    def start_server():
        proto_factory = lambda: WebSocketProtocol(EchoWebSocket)
        return loop.create_server(proto_factory, host, port)

    s = loop.run_until_complete(start_server())
    logger = logging.getLogger('asyncio_testsuite')
    logger.warning("Serving asyncio server on %s:%s" % s.sockets[0].getsockname())
    loop.run_forever()
dataset/ETHPy150Open Lawouach/WebSocket-for-Python/test/autobahn_test_servers.py/run_python3_asyncio/original