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

pangolin

v1.0.11

Published

Introspected tunnels to localhost HTTP/1.1

Downloads

11

Readme

中文版

Introduction

Pangolin, as it's name, is a simple reverse proxy that creates a secure tunnel from a public endpoint to a locally running web app.

HTTP/1.1 requests are transmitted to local by HTTP/2 proxy.

Principle

Web browser <-------HTTP/1.1-------> Public endpoint <-------HTTP/2-------> Local server <-------HTTP/1.1-------> Local web app

We can see that the public or other network's browsers can not access the local network application directly. I open a TCP Server by running in the public network, let the network client to connected by socket, and then based on the connection in the network was created, a HTTP/2 Server can be used to forward each http requests.

I created both HTTP/2 server and client based on node-http2 while I make a little change to make it use a specified socket instance to create server and send requests.

I use h2c (HTTP2 cleartext), so the transmit data from public to local are sent in the clear, the data format is binary because of HTTP/2. It is also quite easy to add TSL, but I didn't do it for a convenient testing.

Instructions

Install pangolin on both server and local side.

sudo npm install -g pangolin --verbose

Command line

  • Server
pangolin server -p 10000  #Start to listen,TCP port 10000
  • Local
pangolin client -r <public ip/domain>:<port> -l <port>
or
pangolin client -r <public ip/domain>:<port> -l <local ip/domain>:<port>

Node.js API

  • Server
var pangolin = require('pangolin');
pangolin.createServer({
  port: 10000,        //TCP port
  httpConnects: 9     //Max http connections
});
  • Local
var pangolin = require('pangolin');
pangolin.connect({
  remoteHost : '127.0.0.1',  //Server IP address
  remotePort : 10000,        //Server TCP port
  localHost  : '127.0.0.1',  //Local web app IP address
  localPort  : 8360,         //Local web app port
  showAccessLog : false      //Display logs or not   
});