I have created a Node.JS application that provides a web socket server (using npm ws). This websocket waits until a connection is established. Once a connection hits the server, the websocket executes a job. When the job is done, a message is sent over the socket, then the socket is being closed. This socket works as expected; already tested it with another Node.JS script.
How can I connect to the web socket using only linux command line tools? I already tried curl as described here. However, I can not find out how to connect properly to my websocket which runs at localhost:8088/socket/
Edit: My question has been identified as a possible duplicate of another question. However, the linked question only asks if there is a way to do it with curl. I'd be glad to see any solution which works on bash. Also, the answer to the linked question is a javascript file using autobahn.ws
My tool websocat is specifically designed for this.
websocat ws://your_server/url
You can connect and exchange data with your server. By default each line becomes a WebSocket text message and vice versa.
On Linux it is more comfortable to play with it using readline:
rlwrap websocat ws://your_server/url.
It is not the only CLI websocket client. There are also "ws" and "wscat" projects.