Ozan Deniz
Ozan Deniz

Reputation: 1087

Python client establish connection with socket.io v1.0 and fire event by websocket

I am using socket.io version 1.0 on the server.(There might be migration problem for versions below 1.0) I have established the connection to the socket.io server with websocket library in python. However, after establishing conneciton i cannot fire events on server side. In docs, it is indicated that the client message, must be sth like this;

data = '42{"name":"fileUploadEvent", "args":[{"msg":"test"}]}'

I think it must fire fileUploadEvent and pass msg paramter to it. But it does'nt fire anything.

When I check the logs, there is no event firing log at the server. Is there any error on protocol or my json format.

Thank you for replies.

Upvotes: 0

Views: 191

Answers (1)

Daniel
Daniel

Reputation: 42758

The correct format is

data = '42["fileUploadEvent",{"msg":"test"}]'

Upvotes: 1

Related Questions