TCP ping utility for node.js. You can test if chosen address accepts connections at desired port and find out your latency. Great for service availability testing.
- It's much faster than
pingtool (as soon as connection gets accepted, it's dropped and a new measure is conducted immediately), so there's no unnecessary waiting between requests.
- It allows you to test a specific service, not the whole connection
- Some servers drop ICMP echo without any response, even when online. TCP can work in such cases.
npm install tcp-ping
options is an object, which may contain several properties:
- address (address to ping; defaults to
- port (defaults to
- timeout (in ms; defaults to 5s)
- attempts (how many times to measure time; defaults to 10)
callback should be a function with arguments in node convention -
Returned data is an object which looks like this:
address: '188.8.131.52'port: 80attempts: 10avg: 197848844max: 35306233min: 16526067results:seq: 0 time: 35306233seq: 1 time: 16585919...seq: 9 time: 17625968
probe(address, port, callback)
callback is a node style callback
function(err, data), where data is true if the server is available and false otherwise.
var tcpp = ;tcpp;tcpp;