Here's how to test a websocket connection using cURL:

$ curl --include \
       --no-buffer \
       --header "Connection: Upgrade" \
       --header "Upgrade: websocket" \
       --header "Host:" \
       --header "Origin:" \
       --header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \
       --header "Sec-WebSocket-Version: 13" \

Just replace with the hostname of your choice and you'll see all the websocket data passing by…

Credits to this Gist on GitHub for the original snippet.

Related Posts

  • SSH Tunnel
  • Installing Packages from a file on Linux
  • TIL: combining PDF files via the command line
  • Get the absolute path of a bash script
  • Creating SSL certificates for localhost