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

localtunnel2

v1.1.4

Published

Expose secure localhost to the world

Readme

Triotunnel

Triotunnel exposes your localhost securely to the world for easy testing and sharing! No need to mess with DNS or deploy just to have others test out your changes.

Great for working with browser testing tools like Browserling or external API callback services like Twilio which require a public URL for callbacks.


☕ Support My Work

If you find my projects helpful, consider supporting me:

Buy Me a Coffee


Quickstart

npx lt2 --port 8000

Installation

Globally

npm install -g localtunnel2

As a dependency in your project

yarn add localtunnel2

CLI Usage

When installed globally, just use the lt2 command to start the tunnel.

lt2 --port 8000 --remote-host https://triotunnel.com

That’s it! It will connect to the tunnel server, set up the tunnel, and tell you what URL to use for testing. The URL will remain active for the duration of your session, so feel free to share it.

You can restart your local server as much as you want — lt2 automatically reconnects once it’s back online.


🧩 Configuration File Support (lt2.config.ts / lt2.config.js)

From version v2.0+, Triotunnel supports loading configuration from a file. This means you can run lt2 without passing CLI arguments.

🔍 Supported Config File Names

The CLI automatically detects these in your working directory:

  • lt2.config.ts
  • lt2.config.js
  • lt2.config.mjs
  • lt2.config.cjs

You can also specify a path manually:

lt2 --config ./myconfig/lt2.config.ts

✅ Example lt2.config.ts

import { defineConfig } from "lt2/config";

export default defineConfig({
  // Default upstream host
  remote_host: "https://example",

  // Local server port
  port: 4000,

  // Tunnel traffic to a local HTTPS server
  local_https: true,

  // Certificate paths
  local_cert: "<Pathto>/cert.pem",
  local_key: "<Pathto>/key.pem",

  // Optional: for self-signed certificates
  // local_ca: "/Users/.../cert.pem",

  // Ignore SSL validation errors for local HTTPS
  allow_invalid_cert: true,

  // Optional subdomain and local hostname
  subdomain: "dev-tunnel",
  local_host: "localhost"
});

🔹 CLI flags override config values if provided. 🔹 Config files can be written in TypeScript, CommonJS, or ESM formats.


🌍 Environment Variables (Optional)

You can also define settings via environment variables (useful for CI/CD):

| Variable | Description | | --------------------- | ------------------------------------------------------------------- | | DEFAULT_SERVER_HOST | Default upstream host (e.g. https://triotunnel.com) | | LOCAL_HTTPS | Enable HTTPS tunneling (true/false) | | LOCAL_CERT | Path to local HTTPS certificate file | | LOCAL_KEY | Path to local HTTPS key file | | LOCAL_CA | Path to CA file for self-signed certificates | | ALLOW_INVALID_CERT | Disable SSL certificate validation for local HTTPS (true/false) |

Example .env:

DEFAULT_SERVER_HOST=https://example.com
LOCAL_HTTPS=true
LOCAL_CERT=/path/to/cert.pem
LOCAL_KEY=/path/to/key.pem
ALLOW_INVALID_CERT=true

CLI Arguments (Optional)

You can still use traditional CLI flags. Below are some common arguments — see lt2 --help for the full list.

| Option | Type | Description | | ---------------------- | ------- | --------------------------------------------- | | --port, -p | number | Local port to expose through Triotunnel | | --remote-host, -h | string | URL for the upstream proxy server | | --subdomain, -s | string | Request a specific subdomain | | --local-host, -l | string | Proxy to this hostname instead of localhost | | --local-https | boolean | Tunnel traffic to a local HTTPS server | | --local-cert | string | Path to local HTTPS certificate | | --local-key | string | Path to local HTTPS key | | --local-ca | string | Path to local CA for self-signed certificates | | --allow-invalid-cert | boolean | Disable certificate checks | | --config, -c | string | Path to a config file (lt2.config.ts, etc.) |

Refer to tls.createSecureContext for certificate details.


Tunnel Events

The tunnel instance returned to your callback emits the following events:

| Event | Args | Description | | --------- | ---- | ---------------------------------------------------------------- | | request | info | Fires when a request is processed (contains method and path) | | error | err | Fires when an error occurs | | close | — | Fires when the tunnel closes |


Tunnel Methods

| Method | Args | Description | | --------- | ---- | ----------------- | | close() | — | Closes the tunnel |


Server

See @triotunnel/server for details on the server that powers Triotunnel.


License

MIT


Thanks To

Influenced by localtunnel Created by defunctzombie