# WebSocket Tester Online - Connect to ws/wss, Send Messages, Heartbeat and SSE Testing

> Free online WebSocket client: connect to ws:// or wss://, send text, JSON or binary messages, read a filterable log, auto-reconnect, plus an SSE tester.

- URL: https://qilingtools.com/en/websocket-test
- Category: Developer Tools (https://qilingtools.com/en/dev)
- Tags: [Developer](https://qilingtools.com/en/tags/dev), [Network & HTTP](https://qilingtools.com/en/tags/network)
- Last updated: 2026-10-26
- Price: Free, no sign-up
- Privacy: Runs locally in the browser; files are never uploaded

When you build chat, live prices, collaborative editing or other real-time features, you need a handy WebSocket client to connect to your server and send messages by hand. Enter a ws:// or wss:// URL (with optional subprotocols) and connect; the status and the negotiated subprotocol and extensions are shown live. Send text, JSON (validated as you type, with one-click formatting and optional minifying) or binary messages entered as hex and sent as an ArrayBuffer, with Ctrl / ⌘ + Enter to send. The message log shows direction, millisecond timestamps and byte size, displays binary messages as a hex + ASCII dump and can pretty-print JSON; filter it by content or direction and export it as JSON or TXT. You can also auto-reconnect with exponential backoff, send a heartbeat message on an interval and save frequent messages as templates stored in your browser. The SSE tab tests Server-Sent Events: open an EventSource, listen for custom event names and see lastEventId. Connections go straight from your browser and never pass through this site. Note that the browser WebSocket API cannot set custom headers such as Authorization.

## How to use

1. Enter a ws:// or wss:// URL, add subprotocols if needed and click Connect
2. Choose text, JSON or binary (hex), type a message and send it
3. Watch the message log, filter or export it, and enable auto-reconnect or heartbeat as needed

## Features

- ws:// and wss:// with subprotocols and negotiated details
- Send text, JSON (validated and formatted) or binary hex
- Millisecond timestamps, direction, byte size and hex dumps
- Log filtering, JSON pretty-printing, JSON / TXT export
- Exponential-backoff auto-reconnect and heartbeat
- Message templates saved locally
- SSE (EventSource) tester with custom events

## FAQ

### Why can’t I set an Authorization header? How do I pass a token?

The browser WebSocket API does not allow custom handshake headers — a browser restriction no web tool can bypass. Common workarounds are a token in the URL query (wss://example.com/ws?token=…), passing it through a subprotocol (Sec-WebSocket-Protocol), or relying on a same-site cookie. Sending an authentication message right after connecting is also a common pattern.

### The connection fails but shows no reason. What should I check?

For security, browsers do not reveal why a WebSocket connection failed; the page only gets error and close events (often code 1006). Check the URL and port, that the server is running, that the wss certificate is valid, whether the server validates the Origin header, and remember that an https page cannot connect to plain ws:// (it is blocked as mixed content). The browser DevTools console and network panel usually show more detail.

### Can I test a local WebSocket server?

Yes for wss://. For ws://localhost, some browsers such as Chrome relax the mixed-content rule for localhost, so it often connects directly. If it is blocked, give your local server a self-signed certificate and use wss://, or run a similar tool from a local http page.

### What is the difference between SSE and WebSocket?

WebSocket is full-duplex: client and server can send messages at any time, which suits chat, games and collaborative editing. SSE (Server-Sent Events) runs over plain HTTP and only lets the server push text events, but it is simpler and has built-in reconnection and event IDs, which suits notifications, log streams and streaming AI output. To test SSE the server must respond with text/event-stream and allow CORS.

## Related tools

- [JSON Formatter](https://qilingtools.com/en/json): Free online JSON formatter: beautify or minify, validate with the exact line and column of any error, browse a collapsible tree, sort keys and escape strings.
- [Base64 Encode/Decode](https://qilingtools.com/en/base64): Free online Base64 encoder and decoder: UTF-8 safe, optional URL-safe variant, convert text to Base64 and back in real time. Processed locally, never uploaded.
- [URL Encode/Decode](https://qilingtools.com/en/url-encode): Free online URL encoder and decoder with encodeURIComponent and encodeURI modes. Escapes Chinese, spaces and special characters. Real-time and local, no upload.
- [JWT Decoder](https://qilingtools.com/en/jwt): Free online JWT decoder: decode the header and payload of a JSON Web Token, show expiry and issued-at times, all locally without uploading the token.
- [Timestamp Converter](https://qilingtools.com/en/timestamp): Free online Unix timestamp converter: convert timestamps and dates, auto-detect seconds or milliseconds, and show local, UTC, ISO 8601 and relative time.
- [Hash / Checksum](https://qilingtools.com/en/hash): Free online hash calculator: SHA-1, SHA-256, SHA-384 and SHA-512 of text or any file through the browser crypto API. Files never leave your device.
- [UUID Generator](https://qilingtools.com/en/uuid): Free online UUID generator: create RFC 4122 UUID v4 in bulk with a cryptographic RNG. Options for uppercase, no hyphens and braces, with one-click copy.
- [Base Converter](https://qilingtools.com/en/base-convert): Free online number base converter: convert between binary, octal, decimal, hexadecimal and any base 2–36. Uses BigInt for huge integers, computed locally.
