Skip to content

Socket.IO

Socket.IO is available by choosing the socketio protocol on a WebSocket request.

Unlike raw WebSocket, Socket.IO carries named events: it is the event’s name that distinguishes one message from another, not its content.

A Socket.IO tab: the server URL, the event name "pet", the JSON payload to emit and the handshake headers

FieldRole
URLThe Socket.IO server’s URL
EventThe name of the event being emitted
MessageThe event’s payload
HeadersThe handshake headers

The Socket.IO connect action is the only one whose outputs are configurable: you declare the list of events you care about, and the box then exposes one port per event, plus:

  • connected — a signal emitted when the connection is established;
  • others — the default port, which receives any event you did not declare.

That is what lets you dispatch cleanly: commande:acceptée on one side, commande:refusée on the other, without writing a condition.

The Socket.IO send (with channel and payload) and Socket.IO close actions complete the lifecycle. See Connections and streams.

Restorm can host a Socket.IO server, which shares its socket with the other servers on the same port. See Mocking WebSocket, Socket.IO and MQTT.