/nodejs-ws-ping-pong

Bare-bones WebSocket ping-pong implementation with Node.js. For testing & educational purposes only.

Primary LanguageJavaScriptThe UnlicenseUnlicense

Node.js WebSocket Ping-Pong

Bare-bones WebSocket ping-pong implementation with Node.js. For testing & educational purposes only.

Hosted on https://nodejs-ws-ping-pong.herokuapp.com

Prerequisites

  • NPM
  • Node.js (tested on 17.8.0)

Testing

Running a simple client-server communication test:

cd server
npm start &
export SERVER_PID=$!
sleep 3
cd ../client-nodejs
npm test
kill $SERVER_PID
cd ..

To test the Heroku deployment, one should instead do:

export NJWSPP_REMOTE=heroku
cd client-nodejs
npm test
cd ..

Testing from the browser:

https://nodejs-ws-ping-pong.herokuapp.com/client.html