WebSocket Tester
Connect to any ws:// or wss:// server directly from your browser.
Send JSON or raw text messages, see responses highlighted in real time with timestamps and byte sizes.
Use Ctrl+Enter to send quickly.
The free echo server at wss://echo.websocket.events is pre-filled to test with instantly.
Frequently Asked Questions
What is a WebSocket and how is it different from HTTP?▼
WebSocket is a protocol that provides a persistent, full-duplex communication channel over a single TCP connection. Unlike HTTP, which is request-response (client initiates every exchange), WebSocket allows both client and server to send messages at any time after the connection is established. This makes it ideal for real-time features like chat, live dashboards, multiplayer games, and collaborative editing.
What is the difference between ws:// and wss://?▼
ws:// is unencrypted WebSocket — equivalent to http://. wss:// is WebSocket over TLS — equivalent to https://. Always use wss:// in production to protect data in transit. Modern browsers may block ws:// connections from secure (https://) pages due to mixed content restrictions. For local development, ws://localhost is fine.
How do I test my WebSocket server?▼
Enter your server URL (e.g. wss://myapp.com/ws) in the URL field and click Connect. Once connected, type a message and press Send or Ctrl+Enter. The message log shows both sent and received messages with timestamps and byte sizes. If you don't have a server ready, use the pre-filled echo server (wss://echo.websocket.events) — it reflects back everything you send.
Why does my WebSocket connection fail?▼
Common causes: (1) Wrong URL or port — double-check the endpoint. (2) TLS mismatch — use wss:// for HTTPS pages, ws:// for HTTP. (3) Server not running — make sure the server process is live. (4) Firewall or proxy blocking WebSocket upgrades — corporate networks often block WebSocket. (5) Missing CORS headers on the WebSocket handshake — check your server's allowed origins.
How do I send JSON over WebSocket?▼
WebSocket transmits raw strings or binary data — it has no built-in JSON framing. The convention is to JSON.stringify() your message before sending and JSON.parse() on receipt. This tester formats JSON messages automatically in the log. To send JSON, type a valid JSON object in the message input and the server will receive it as a string.
What are WebSocket subprotocols?▼
Subprotocols (Sec-WebSocket-Protocol header) let client and server agree on a message format or application-level protocol on top of WebSocket. Examples: STOMP (messaging), MQTT (IoT), graphql-ws (GraphQL subscriptions), or custom application protocols. If your server requires a specific subprotocol, you'd need to specify it in the connection headers — not all testing tools support this out of the box.
Related Products
on GumroadAPI Testing Cheatsheet Pack
Quick-reference cheatsheets for REST, GraphQL, and WebSocket testing. Includes Postman collections, shell scripts for smoke tests and load tests, and JWT decoder.
Buy on Gumroad →Developer Productivity Bundle
Stop rebuilding the same setup every project. 51 VSCode snippets, 40 Git aliases, 5 Docker Compose stacks, 5 GitHub Actions workflows, 5 README templates, and a dotfiles kit. Set up a professional dev environment in under an hour.
Buy on Gumroad →AI Prompt Engineering Toolkit
58 structured prompt templates for Claude, ChatGPT, and Gemini — organized by use case. Code Review, Debugging, Documentation, Architecture, and 10 model-specific tips. Stop writing prompts from scratch.
Buy on Gumroad →You Might Also Need
OpenAPI Validator
Paste your OpenAPI 3.x spec (YAML or JSON) to validate structure, find missing required fields, detect duplicate paths, check for missing operationIds, and get errors and warnings with path references.
Open free tool →
HTTP Status Code Reference
Complete HTTP status code reference. Search all 1xx, 2xx, 3xx, 4xx, and 5xx codes with plain-English descriptions, real-world use cases, and when to use each in REST APIs.
Open free tool →
API Request Builder
Build and test HTTP requests visually with any method, headers, and body. Generate cURL commands instantly. Free online API testing tool with Pro unlimited access. No signup required.
Open free tool →
More Free Tools
Related Articles
curl 深度使用手冊:API 測試從入門到進階
curl 是每位開發者必備的 CLI 工具。本文涵蓋 GET/POST/PUT/DELETE 請求、認證、header 設定、檔案上傳、除錯技巧,以及 REST API 測試的完整實戰範例。
API Testing in 2026: From cURL to Automated Test Suites
Complete API testing guide 2026: cURL basics to Postman, Insomnia, and automated suites with JavaScript and Python. Real examples included.
IP Geolocation Lookup: How to Find Location, ISP, and Timezone from an IP Address
Learn how IP geolocation works, which APIs and tools to use, and how to implement IP-based features in your app. Covers country detection, timezone lookup, and rate limiting by region.
Webhook Testing: How to Debug, Inspect, and Replay Webhooks in 2026
Complete guide to webhook testing. Covers local tunneling, replay tools, signature verification, retry handling, and the best practices for testing webhooks without production data.
Complete HTTP Status Codes Reference for REST API Devs
The complete HTTP status codes reference for REST API developers. Every 1xx, 2xx, 3xx, 4xx, and 5xx code explained with real-world API examples and best practices.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$9/mo after trial · Cancel anytime
Want the full toolkit?
Get DevPlaybook Pro
Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →