NodeJS server to calculate the approximate ping from the browser to any server using web-sockets.
This is not a perfect ping calculation but I came to a good approximation improving the client flow.
$ git clone git@github.com:sirgalleto/ping-server.git$ cd ping-server$ npm install
- Run the service
$ npm start. - Create a socket connection to port 3500 (you can change the port creating a env var called PORT)
- Emit a
ping2event. - Receive a
pong2event. - Calculate the events interval.