Test Socket.IO connectivity

To test the connectivity to the Express Socket.IO server use the following command from a terminal window

npx wscat -c ws://localhost:3000/socket.io/\?transport=websocket

npx: installed 11 in 4.89s
0{“sid”:”vOQHhey-0EYPaAvVAAAA”,”upgrades”:[],”pingInterval”:25000,”pingTimeout”:5000}
40

If the return value is 40, in the next 30 seconds the server is listening for new events (pingInterval ms + pingTimeout ms).

You can send one with the command
42[“EVENT_NAME”, “ATTRIBUTE1”, “ATTRIBUTE2”]

# Example
42["version"]

Leave a comment

Your email address will not be published. Required fields are marked *