Socket IO - amitsri/rostyman-releases GitHub Wiki

Socket.IO

Rostyman supports Socket.IO connections for real-time event-driven communication.

Creating a Socket.IO Connection

  1. Click the + button in the tab bar โ†’ Socket.IO
  2. Or use the New Request dialog and select Socket.IO

Connection

URL

Enter your Socket.IO server URL in the URL bar (e.g., http://localhost:3000).

Connect / Disconnect

  • Click Connect to establish a connection
  • The status dot shows: gray (disconnected), yellow (connecting), green (connected), red (error)
  • Click Disconnect to close the connection
  • Auto-reconnection is enabled by default (5 attempts, 1s delay)

Tabs

Emit

Send events to the server:

  • Event name โ€” the event type to emit (e.g., message, join, chat)
  • Data โ€” JSON payload in the Monaco editor
  • Click Emit to send (only enabled when connected)

Events

All incoming events are automatically captured and displayed in the message log below. The onAny listener captures every event โ€” no need to manually subscribe.

Settings

Configure connection options (set before connecting):

  • Path โ€” Socket.IO path (default: /socket.io)
  • Auth (JSON) โ€” authentication payload sent on connection (e.g., {"token": "..."})
  • Query Params (JSON) โ€” query parameters appended to the handshake URL

Message Log

The bottom panel shows all communication:

  • Sent (green โ†‘) โ€” events you emitted
  • Received (blue โ†“) โ€” events from the server
  • System (ยท) โ€” connection, disconnection, error messages

Filter buttons: All, Sent, Received, System. Clear button to reset the log.

Each entry shows: timestamp, direction, event name, and data payload.

Tips

  • Socket.IO uses WebSocket transport by default, with HTTP long-polling as fallback
  • Auth payload is sent during the initial handshake โ€” set it before connecting
  • The message log is ephemeral โ€” cleared when you close the tab
  • Use JSON format for data payloads for best compatibility