Code Monkey home page Code Monkey logo

simpleping's Introduction

SimplePing

SimplePing is a lightweight website that enables users to easily determine the network latency from the browser to a hosted server.

Why SimplePing

Sometimes, you don't want to fire up a terminal just to ping a server. Other times, ICMP packets might behave differently from TCP packets. SimplePing measures round-trip latency using a WebSocket connection, which is a TCP-based connection that can run simultaneously alongside an HTTP(S) connection. WebSocket has lower network overhead compared to HTTP, and thus returns results that are more representative of the actual network latency.

๐Ÿš€ Running

You can get this working on your server in a few steps. Make sure you have a recent version of Node.js and NPM installed.

  1. Clone the repo and install the NPM dependencies:
git clone https://github.com/TypingKoala/SimplePing.git && cd SimplePing && npm install
  1. Create a config.json file and copy/paste the following JSON. You should specify the geographic location of the server in location. If your website will be using SSL, set the ssl flag to true and specify the path to the SSL Key and Certificate file. Otherwise, set the ssl flag to false and remove the keyPath and certPath attributes.
{
    "location": "New York",
    "ssl": true,
    "keyPath": "/root/ssl/simpleping.key",
    "certPath": "/root/ssl/simpleping.cert"
}
  1. Start the server. You also can use forever-cli to run and manage SimplePing in the background.
node index.js
  1. Open your browser to http://localhost:3000 (or https://localhost:3000 if ssl=true) and see it work! Note that the latency will be pretty low since you are running it locally. Try accessing the page from a remote computer, either at the same port or using an HTTP proxy.

simpleping's People

Contributors

typingkoala avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.