New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tcp-connect.js

Tests TCP connections by opening a TCP socket to the given host:port


Version published
Maintainers
1
Created

tcp-connect.js

Tests TCP connections by opening a TCP socket to the given host:port.

Installation

$ npm install -g tcp-connect.js

Examples

$ tcp-connect www.apple.com:80
success: www.apple.com:80

$ tcp-connect www.apple.com:80 8.8.8.8:53 192.0.2.0:65535 unknown.example.com:80
success: www.apple.com:80
success: 8.8.8.8:53
failure: unknown.example.com:80 -- Error: getaddrinfo ENOENT
failure: 192.0.2.0:65535 -- Error: connect ETIMEDOUT

$ cat test/example.txt | tcp-connect
failure: localhost:54321 -- Error: connect ECONNREFUSED
ignored: www.google.com:80
success: 8.8.8.8:53
success: www.apple.com:80
failure: unknown.example.com:80 -- Error: getaddrinfo ENOENT
failure: 192.0.2.0:65535 -- Error: connect ETIMEDOUT

$ tcp-connect
www.google.com:80
success: www.google.com:80
www.yahoo.com:80
success: www.yahoo.com:80
^C

$ tcp-connect #www.google.com:80
ignored: www.google.com:80

FAQs

Package last updated on 08 Jun 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts