I see that there is websocket endpoint which works out fins with Java tests. In logs I see
Connecting to: ws://127.0.0.1:8080/76f48a44-0af8-444c-ba97-3f1ed34af
I have used this and found it to be quite simple
http://www.websocket.org/echo.html
I wrote a cURL like WebSocket client. You can send single data frame (text/binary) via this tool and then it closes the socket. Also you can add HTTP headers in the initial HTTP upgrade process.
https://github.com/jussmen/WebSocket_cURL
I had to use this command to make it work:
$ curl -i -N -H "Connection: Upgrade" -H "Upgrade: websocket" -H "Host: echo.websocket.org" -H "Origin: http://www.websocket.org" -H "Sec-WebSocket-Version: 13" -H 'Sec-WebSocket-Key: +onQ3ZxjWlkNa0na6ydhNg==' http://www.websocket.org
I am using Jetty, and if I didn't add the Sec-WebSocket-Version/Sec-WebSocket-Key doesn't work. Just for the record.
For completeness, I'd like to add my own CLI tool: websocat.
$ websocat wss://echo.websocket.org/
qwer
qwer
1234
1234
It does not do the "browser" part of the question, but should be a valid substitute for "curl" in this case.
This did the trick for me:
$ curl -i -N -H "Connection: Upgrade" -H "Upgrade: websocket" -H "Host: echo.websocket.org" -H "Origin: http://www.websocket.org" http://echo.websocket.org
from: http://www.thenerdary.net/post/24889968081/debugging-websockets-with-curl
If you mean literally to test the implementation of websockets, I found Autobahn's test suite to be very useful: http://autobahn.ws/
If you just want to noodle with a websocket I would recommend using the developer tools in a browser like chrome to make a connection and send/recv data:
var ws = new WebSocket("ws://127.0.0.1:8080/76f48a44-0af8-444c-ba97-3f1ed34afc91/tweets");
ws.onclose = function() { // thing to do on close
};
ws.onerror = function() { // thing to do on error
};
ws.onmessage = function() { // thing to do on message
};
ws.onopen = function() { // thing to do on open
};
ws.send("Hello World");