TestingAPIs is still being built. If something breaks, email support@testingapis.com.

Open a WebSocket that echoes every message back

GETwss://api.testingapis.com/ws/echoSign in to see this endpoint's URL

On connect the server sends a JSON welcome message. Text and binary messages are echoed unchanged; sending the text close makes the server close with 1000 "Bye!". Messages over 64KB are rejected with close code 1009.

Swagger UI cannot open WebSockets. Use a WebSocket client instead:``wscat -c wss://api.testingapis.com/ws/echoSwagger UI cannot open WebSockets. Use a WebSocket client instead:``wscat -c wss://api.testingapis.com…

Responses

200
OK
101
Switching Protocols: the WebSocket is open.
400
The request was plain HTTP rather than a WebSocket upgrade.

Example

Request
curl -X GET "https://api.testingapis.com/ws/echo" \
  -H "X-TestingApis-Key: YOUR_API_KEY"
Response
WebSocket. Connect with ws://{host}/ws/echo. Every text or binary message is echoed back; send "close" to make the server close the socket.
> hello
< hello
> close
< (server closes: 1000 "Bye!")

Sign in to see the details

The parameters, request and response examples and the live Try it panel for this endpoint are for signed-in members. Accounts are free and take a few seconds to create.