I have a JS program that runs Socket.io. It works properly with Flask-SocketIO and I’m trying to migrate it to Sanic.
So, basically, I’ve added a @app.websocket(’/socket.io/’), like this:
@app.websocket("/socket.io") async def feed(request, ws): while True: data = await ws.recv() print("Received: " + data)
The idea is to first validate that it works.
If I add a send data first, I have a “server error” displayed on the JS console and the connection fails.
How can I connect the two?