npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tunnel.js

v1.0.12

Published

Create a tunnel for port forwarding/reversing in most restricted network

Downloads

4

Readme

tunnel.js

Create a tunnel for port forwarding/reversing in most restricted network

Currently only support TCP tunnel and TCP forwarding/reversing.

TODO:

  • Support TLS tunnel
  • Support UNIX Domain Socket Tunnel
  • Support SMB named pipe tunnel
  • Support forwarding/reversing shell exec.
  • Support authentication.

##Usage (you can also install it by npm install -g tunnel.js)

  • Tunnel Server
tunnel-listen.js [localAddress:]port
  • Tunnel Client
tunnel-connect.js [host:]port [-source [localAddress:]port] ...

You can input instructions from arguments or standard input:

forward [localAddress:]port [destHOST:]PORT
reverse [localADDRESS:]PORT [destHost:]port

You can input instructions from arguments or standard input:

end-forward [[localAddress:]port]
end-reverse [[localADDRESS:]PORT]
list
  • Notes:
    • Uppercase args just means they are in sense of the tunnel server.
    • IPv6 address must be wrapped by square brackets, e.g. [::1]:8080

#Sample Assume you have a network consisted of HOST_FOR_INNER and HOST_FOR_OUTER

  • Network rules only allow HOST_FOR_INNER:1111 -> HOST_FOR_OUTER:2222, not reverse
  • only HOST_FOR_OUTER can go to ANYWHERE_OUTSIDE
  • only HOST_FOR_INNER can go to SOMEWHERE_INSIDE

port forwarding

On HOST_FOR_INNER, you want to connect to SOMEWHERE_OUTSIDE:8888 via a local port 9999 which will be forwarded to the target. You can do it by following steps:

  • on HOST_FOR_OUTER: Run a tunnel server
tunnel-listen.js 2222
  • on HOST_FOR_INNER: Connect to the tunnel server and instruct it to create a port forwarder
tunnel-connect.js HOST_FOR_OUTER:2222 -source HOST_FOR_INNER:1111 \
 forward 9999 SOMEWHERE_OUTSIDE:8888

port reversing

On HOST_FOR_OUTER, you want to connect to SOMEWHERE_INSIDE:8888 via a local port 9999 which will be forwarded to the target. You can just change the above forward command to reverse as following:

  • on HOST_FOR_INNER: Connect to the tunnel server and instruct HOST_FOR_OUTER to create a port forwarder
tunnel-connect.js HOST_FOR_OUTER:2222 -source HOST_FOR_INNER:1111 \
 reverse 9999 SOMEWHERE_INSIDE:8888