You might like websocat. It’s a command line tool that lets you make WebSocket connections, sending standard input to it, and spitting received WebSocket message data back out to standard output.
You can cat a JSON file with a [“REQ”] message, then read back the contents, for example. There are command line flags for things like keeping the socket open. https://github.com/vi/websocat