WebSocket and Server-Sent Events Tester

Open a WebSocket or SSE stream, send JSON or text with counters and timestamps, watch every frame with time and size, and export the log.

Berjalan dalam pelayar anda. Fail anda tidak pernah meninggalkan peranti. Lihat cara menyemaknya

…

Cara melakukannya

  1. 1
    Create a session

    Press + Session, name it and choose WebSocket, SSE (EventSource) or SSE via fetch.

  2. 2
    Enter the URL

    Type the wss:// or https:// address and any subprotocols or headers.

  3. 3
    Connect

    Press Connect and watch the state badge and the system lines in the log.

  4. 4
    Send messages

    Write a message with templates and press Send, or start a timed repeat.

  5. 5
    Save favourites

    Press Save message to keep messages or named SSE events in the session.

  6. 6
    Review and export

    Filter the log, toggle pretty JSON and download it as JSON or CSV.

Tentang alat ini

Real-time features such as chat, live prices, notifications or progress bars usually run over WebSockets or Server-Sent Events, and both are awkward to test with ordinary HTTP clients. This tester connects directly from your browser. For WebSockets you can choose subprotocols, send messages written in an editor with live JSON checking, insert counters, timestamps and random ids, save messages you send often and repeat one on a timer. For SSE you can use the browser's EventSource, or a fetch-based reader that can send custom headers and POST bodies, parsed exactly as the HTML standard describes. Every frame is logged with direction, time, size, event type and id.

Who this is for

Back-end developers building socket or streaming endpoints, front-end developers checking message shapes, and QA engineers reproducing real-time bugs.

Sessions

A session stores the protocol, URL, subprotocols, headers and saved messages. Create one per service or environment and switch between them; connections close when you switch.

WebSocket mode

Connect opens the socket and logs the time it took and the negotiated subprotocol. Messages can include {{counter}}, {{timestamp}}, {{iso}}, {{uuid}} and {{rand}}, which are filled in at send time. If the text starts like JSON it is checked before sending. Repeat every n milliseconds is useful for keep-alive pings and load-like tests (minimum 100 ms). Binary frames are shown as hexadecimal bytes. When the socket closes, the close code and reason are logged, for example 1000 for a normal close or 1006 when the connection dropped.

SSE with EventSource

EventSource is the standard browser client. It reconnects automatically and handles last event ids. It cannot send headers, so it suits public or cookie-authenticated streams. Messages without an event name arrive as message; add the names of custom events as saved entries to listen for them too.

SSE with fetch

For streams that need an Authorization header or a POST body, as many AI and notification APIs do, the fetch mode reads the response body and parses it with the HTML standard's rules: data lines are joined with newlines, event sets the type, id sets the last event id, retry must be digits, lines starting with a colon are comments, and an empty line dispatches the event.

The log

Incoming frames are blue, outgoing green, system messages grey and errors red. Filter by text, toggle pretty JSON, and export the log as JSON or CSV with ISO timestamps, which is handy for bug reports.

Worked example

Connect to wss://echo.websocket.org, send { "type": "ping", "n": {{counter}} } three times and the log shows three outgoing frames with n = 1, 2 and 3 and the echoed replies, each about 30 bytes, with the round trip visible from the timestamps.

Limits

The browser connects directly, so the server must accept connections from this site: WebSocket servers may check the Origin header, and SSE or fetch streams to another domain need CORS headers. Browsers do not allow custom headers on WebSocket handshakes, and an https page cannot open ws:// or http:// endpoints. Public test servers may be unavailable at times.

Contoh berselesaian

echo server: 3 pings sent with {{counter}}, 3 echoes received, log exported as CSV.

Ringkasnya

Soalan lazim

Why does my WebSocket fail with no details?

Browsers hide the reason for security. Check the URL, the TLS certificate, and whether the server rejects this site's Origin.

Can I send an Authorization header?

Not on WebSockets from a browser. Use a token in the URL or a first message. For SSE, use the fetch mode.

What does close code 1006 mean?

The connection ended without a proper close frame, usually a network drop, proxy timeout or server crash.

Can I test against localhost?

Browsers allow ws://localhost and http://localhost even from https pages in many cases, but some block it; if so, use wss with a local certificate.

Are messages stored?

Sessions and saved messages are kept in this browser. The live log stays in memory until you export or clear it.

Does traffic go through shobfree.com?

No. Your browser connects directly to the server you enter.

Percuma sepenuhnyaTiada bayaran, tiada pendaftaran
Fail kekal peribadiSemuanya berjalan dalam pelayar anda
Mudah dalam bahasa andaTersedia dalam banyak bahasa