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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@antash-mishra/tunnel-client

v1.0.0

Published

Client for WebSocket tunnel server, allowing local server exposure.

Readme

WebSocket Tunnel Client

A simple, command-line WebSocket-based tunnel client that allows you to expose your local server to the internet through a tunnel server.

NPM License: MIT

This tool connects to a compatible WebSocket tunnel server (like the one in the parent directory of this project) and forwards incoming public requests to a specified local server.

Features

  • Expose any local HTTP/HTTPS server to a public URL.
  • Connects via secure (WSS) or insecure (WS) WebSockets.
  • Simple command-line interface.
  • Automatic reconnection attempts on disconnect.
  • Configurable tunnel server URL.

Installation

Install the client globally using npm:

# Option 1: Install directly from the source code (for development)
cd client # Navigate to this directory
npm install -g .

# Option 2: Install from NPM (if published)
# npm install -g websocket-tunnel-client

This installation makes the tunnel-client command available system-wide in your terminal.

Usage

The basic command structure is:

tunnel-client <local-server-url> [options]

Arguments:

  • <local-server-url>: Required. The full URL of your local server that you want to expose. Include the protocol (http or https).
    • Example: http://localhost:3000
    • Example: https://127.0.0.1:8443

Options:

  • -s, --server-url <url>: The WebSocket URL (ws:// or wss://) of the tunnel server to connect to.
    • Defaults to ws://localhost:8080 (useful if running the server locally).
    • For a deployed server (e.g., on Fly.io), use its public WebSocket address like wss://your-app-name.fly.dev.
  • -h, --help: Display help information and exit.

Examples:

  1. Expose local server http://localhost:5000 using the default tunnel server (ws://localhost:8080):

    tunnel-client http://localhost:5000
  2. Expose local server http://127.0.0.1:8080 using a specific, deployed tunnel server:

    tunnel-client http://127.0.0.1:8080 -s wss://my-tunnel-app.fly.dev
  3. Expose a local HTTPS server:

    tunnel-client https://localhost:8443

Upon successful connection, the client will print the assigned public URL.

How It Works

  1. The tunnel-client CLI connects to the specified --server-url via WebSocket.
  2. The tunnel server accepts the connection and assigns a unique Tunnel ID.
  3. The client prints the public URL constructed from the server URL and the Tunnel ID (e.g., https://my-tunnel-app.fly.dev/<tunnel-id>).
  4. When an HTTP request hits the public URL:
    • The tunnel server forwards the request details (method, path, headers, body) to the connected client over the WebSocket.
    • The tunnel-client receives the details and makes an equivalent HTTP/HTTPS request to your <local-server-url>.
    • The response from your local server (status, headers, body) is captured by the tunnel-client.
    • The client sends the response details back to the tunnel server over the WebSocket.
    • The tunnel server sends the HTTP response back to the original requester.

Development (Contributing)

  1. Clone the main project repository.
  2. Navigate to the client directory: cd client
  3. Install development dependencies: npm install
  4. Make your code changes in tunnel-client.js.
  5. You can run the client directly during development without global installation:
    node tunnel-client.js http://localhost:3000 --server-url ws://localhost:8080

License

MIT

Running as a Service (Optional)

For persistent operation after global installation, you can use a process manager like PM2:

pm2 start $(which tunnel-client) --name "my-tunnel" -- <local-server-url> [options]
# Example:
pm2 start $(which tunnel-client) --name "api-tunnel" -- http://localhost:3001 -s wss://my-tunnel-server.com