Setup

  1. You'll have to run a WebSocket server locally for this test. You can get one at ws_server.js.
  2. Make sure you have the
    ws
    package:
    npm install ws
  3. Run the script locally:
    node ws_server.js

How to test

Check dev console - this page runs a script that tries to establish a WebSocket connection to a localhost server on port 8080.
You should get a permision prompt. If you, allow you should get a message saying that "ping from server" in the console.
On your localhost server, you should see a message saying "pong from client!".
If you block, you should get a message saying "WebSocket error!" in the console.