New in 2.4: Test runs you can trust See what's new →

WebSocket

WebSocket test endpoints (app.UseWebSockets is registered in Program.cs): /ws/echo — echoes every text/binary message; send "close" to be disconnected. /ws/ticker — pushes a deterministic stock tick every second (?count=, max 300). Plain HTTP requests get a 400 explaining how to connect.

Example request

Open a WebSocket that echoes every message back. Full reference and a Send button.

cURL
curl -X GET "https://api.testingapis.com/ws/echo"
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!")