https://github.com/danielzzz/node-portchecker
a simple tcp port checker / scanner for node
https://github.com/danielzzz/node-portchecker
Last synced: 4 months ago
JSON representation
a simple tcp port checker / scanner for node
- Host: GitHub
- URL: https://github.com/danielzzz/node-portchecker
- Owner: danielzzz
- Created: 2010-09-29T10:35:26.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2016-11-22T11:36:58.000Z (about 8 years ago)
- Last Synced: 2024-10-30T04:55:39.934Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 22
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
NODE-PORTCHECKER
A simple tcp port checker for nodeLICENSE MIT
(C) Daniel Zelisko
http://github.com/danielzzz/node-portcheckerDESCRIPTION
This library allows for easy and simple tcp port checking.
It can be used for determining if a given port is open, or to find a first available portINSTALLATION:
npm install portcheckerAPI:
getFirstAvailable(startPort, endPort, host, cb)
returns first available port in a given range cb(port, host)getAllOpen(startPort, endPort, host, cb)
returns array of available ports for a given hosts in a given range cb(openPorts, host)isOpen(port, host, callback)
returns true if a given host:port is open cb(isOpen, port, host)setTimeout(milisecs)
configure timeout for port probing (default 400 milisecs)EXAMPLE:
//find first available port between 80 and 90 on localhost
portchecker.getFirstAvailable(80, 90, 'localhost', function(p, host) { console.log(host+":"+p+" is free");});