-
Hi all, I have this minimal example: from sanic import Sanic
import socketio
sio = socketio.AsyncServer(async_mode="sanic", cors_allowed_origins="*")
app = Sanic("SanicSocketIOTest")
sio.attach(app)
@sio.event
async def connect(sid):
print(f"{sid} connected")
@sio.event
async def disconnect(sid):
print(f"{sid} disconnected")
@sio.event
async def message(sid, data):
print(f"[{sid}/message] {data}")
await sio.emit("message", data)
if __name__ == "__main__":
app.run() However on running this I am unable to make socket.io connections to the server. I'm stuck on trying to connect (from Postman in this case) and see the following log output from my server.
I've never used this library before, am I missing something? |
Beta Was this translation helpful? Give feedback.
Answered by
kiliankoe
Jul 20, 2023
Replies: 1 comment
-
Ah, I'm an idiot that can't read logs. I kept thinking it was referring to another internal |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
kiliankoe
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ah, I'm an idiot that can't read logs. I kept thinking it was referring to another internal
connect
function (mine was previously named differently), but the issue is just that my connect function needs to provide a second argument.