Not every API waits for you to ask. Chat apps, live dashboards and IoT devices push data as it happens. Hoppscotch’s Realtime section can open and hold these connections, send messages and log everything that comes back. It supports four protocols.

Which protocol is which?

ProtocolDirectionTypical use
WebSocketBoth waysChat, multiplayer, live collaboration
Server-Sent Events (SSE)Server to client onlyNotifications, live feeds, progress updates, AI text streaming
Socket.IOBoth ways, event-basedNode.js apps using the Socket.IO library
MQTTPublish/subscribe through a brokerIoT sensors and devices, messaging between services

WebSocket

  1. Open Realtime → WebSocket.
  2. Enter a server address starting with wss:// (secure) or ws://. For practice, the echo server suggested by Hoppscotch — or the public wss://echo.websocket.org — sends back whatever you send.
  3. Click Connect. The log shows when the connection opens.
  4. Type a message (plain text or JSON) and send it. With an echo server, the same message appears in the log as received.

If the server needs a sub-protocol, add it in the protocols field before connecting. Click Disconnect when you’re done so the server can clean up.

Server-Sent Events

SSE uses a normal HTTP connection that the server keeps open, sending events as lines of text.

  1. Open Realtime → SSE.
  2. Enter the URL of an endpoint that returns text/event-stream.
  3. Optionally set the event type to listen for (the default is message).
  4. Start the connection and watch events appear in the log.

If nothing arrives, check in the REST screen that the endpoint really responds with the text/event-stream content type.

Socket.IO

Socket.IO adds its own handshake and an event system on top of WebSocket, so a plain WebSocket client can’t talk to it — use the dedicated screen.

  1. Open Realtime → Socket.IO and enter your server URL.
  2. Pick the client version matching your server (Socket.IO versions are not fully compatible with each other).
  3. If your server uses a custom path instead of /socket.io, set it.
  4. Connect, then emit an event: give it a name such as chat:message and a JSON payload.
  5. Events the server emits back are listed in the log.

MQTT

MQTT clients don’t talk to each other directly. They connect to a broker, subscribe to topics and publish messages to topics.

  1. Open Realtime → MQTT.
  2. Enter a broker URL that supports MQTT over WebSockets. The public test broker run by the Eclipse Mosquitto project, wss://test.mosquitto.org:8081, is handy for experiments.
  3. Connect, then subscribe to a topic with a unique name, for example yourname/test/temperature.
  4. Publish a message such as {"celsius": 21.5} to the same topic. It appears in your subscription log.

Public test brokers are visible to everyone. Never send real data or credentials to them, and use unusual topic names so you don’t collide with other people’s tests.

Tips for realtime testing

  • Use the desktop app for servers on localhost or inside a private network.
  • Watch for silent disconnects: many servers close idle connections after a timeout.
  • Keep the message log open while you trigger actions in your app — it’s a quick way to see exactly what the server pushes.