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 🙏

© 2025 – Pkg Stats / Ryan Hefner

tunnel-fast

v1.0.5

Published

Fast and secure tunnel client for exposing local services

Readme

Tunnel Fast

Fast and secure tunnel client for exposing local services to the internet.

Features

  • Expose local services through secure tunnels
  • Token-based authentication
  • Path-based routing (no subdomain required)
  • Simple CLI interface
  • Can be used as a library or CLI tool

Installation

Global installation (CLI)

npm install -g tunnel-fast

Local installation (Library)

npm install tunnel-fast

Usage

CLI

# Basic usage
tunnel-fast start --port 3000 --server https://tunnel.yourdomain.com --key your-master-key

# Using environment variables
export TUNNEL_SERVER=https://tunnel.yourdomain.com
export TUNNEL_MASTER_KEY=your-master-key
tunnel-fast start --port 3000

# Show help
tunnel-fast --help

Using Environment Variables (Optional)

You can set environment variables instead of passing arguments:

export TUNNEL_SERVER=https://tunnel.yourdomain.com
export TUNNEL_MASTER_KEY=your-secret-master-key
tunnel-fast start --port 3000

Programmatic Usage

const TunnelClient = require('tunnel-fast');

const client = new TunnelClient({
  serverUrl: 'https://tunnel.yourdomain.com',
  masterKey: 'your-master-key',
  localPort: 3000
});

client.on('tunnel-created', (data) => {
  console.log('Public URL:', data.publicUrl);
  console.log('Access Token:', data.accessToken);
  console.log('Full URL:', `${data.publicUrl}?token=${data.accessToken}`);
});

client.on('request', (reqData) => {
  console.log(`${reqData.method} ${reqData.path}`);
});

client.on('error', (error) => {
  console.error('Error:', error.message);
});

client.connect();

How it works

  1. Client connects to your tunnel server with master key
  2. Server validates the master key and creates a tunnel
  3. Server returns a unique tunnel ID and access token
  4. Your local service is now accessible at: https://server.com/t/{tunnelId}?tunnel-token={accessToken}
  5. Requests to that URL are forwarded to your local service

Options

CLI Options

  • -p, --port <port> - Local port to expose (default: 3000)
  • -s, --server <url> - Tunnel server URL
  • -k, --key <key> - Master key for authentication
  • -V, --version - Show version number
  • -h, --help - Show help

Client Options

new TunnelClient({
  serverUrl: 'https://server.com', // Required: Tunnel server URL
  masterKey: 'your-key',            // Required: Master key for authentication
  localPort: 3000                   // Optional: Local port (default: 3000)
})

Events

The client emits the following events:

  • connected - Connected to tunnel server
  • tunnel-created - Tunnel successfully created (provides URL and token)
  • request - Incoming request received
  • error - Error occurred
  • disconnected - Disconnected from server

Server Setup

You need to deploy the tunnel server first. See the tunnel-fast-server repository for instructions.

Quick setup:

  1. Deploy tunnel-fast-server to your hosting service
  2. Set MASTER_KEY environment variable
  3. Set PUBLIC_URL to your public server URL
  4. Use that server URL with this client

Security

  • Master key is required to create tunnels (keep it secret!)
  • Each tunnel gets a unique access token
  • Tokens are required to access tunnels
  • Tokens can be passed via query parameter tunnel-token or X-Tunnel-Token header

License

MIT

Publishing

This package is automatically published to NPM via GitHub Actions. See PUBLISHING.md for details.

Contributing

Pull requests are welcome! For major changes, please open an issue first.