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

ctunnel

v1.0.3

Published

Expose localhost to the world with API key authentication (Fork of localtunnel)

Readme

ctunnel

ctunnel exposes your localhost 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.

About ctunnel

ctunnel is a fork of localtunnel, customized for users of claude.ws.

Key differences from upstream localtunnel:

  • API Key Authentication: Requires an API key (ct_live_ format) for tunnel creation
  • Default Server: Uses https://claude.ws as the default tunnel server
  • Enhanced Error Handling: Graceful handling of authentication errors (401, 503)

Getting an API Key

The tunnel server requires an API key for authentication. To get your API key:

  1. Visit https://claude.ws/access to create an account
  2. Generate your API key from the dashboard
  3. Use the key with ctunnel

API key format: ct_live_ followed by 32 hex characters.

Quickstart

npx ctunnel --port 8000 --key ct_live_your_api_key_here

Installation

Globally

npm install -g ctunnel

As a dependency in your project

yarn add ctunnel

Homebrew

brew install ctunnel

CLI usage

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

ctunnel --port 8000 --key ct_live_your_api_key_here

Thats it! It will connect to the tunnel server, setup the tunnel, and tell you what url to use for your testing. This url will remain active for the duration of your session; so feel free to share it with others for happy fun time!

You can restart your local server all you want, ctunnel is smart enough to detect this and reconnect once it is back.

Arguments

Below are some common arguments. See ctunnel --help for additional arguments

  • --port or -p (required) Internal HTTP server port
  • --key or -k API key for tunnel server authentication
  • --subdomain or -s request a named subdomain on the tunnel server (default is random characters)
  • --release or -r <subdomain> release/delete a subdomain
  • --local-host or -l proxy to a hostname other than localhost
  • --host or -h upstream tunnel server (default: https://claude.ws)
  • --version or -v show version number
  • --help show help

Usage Examples

With CLI flag:

ctunnel --port 3000 --key ct_live_0123456789abcdef0123456789abcdef

With short flags:

ctunnel -p 3000 -k ct_live_0123456789abcdef0123456789abcdef

With environment variable:

export CTUNNEL_KEY=ct_live_0123456789abcdef0123456789abcdef
ctunnel --port 3000

With custom subdomain:

ctunnel -p 3000 -s myapp -k ct_live_0123456789abcdef0123456789abcdef

Release a subdomain:

ctunnel --release myapp --key ct_live_0123456789abcdef0123456789abcdef

Check version:

ctunnel -v

Environment variables:

You may also specify arguments via env variables. E.x.

PORT=3000 ctunnel

Available environment variables:

  • CTUNNEL_KEY - Your API key
  • CTUNNEL_SERVER - Tunnel server URL (default: https://claude.ws)

API

The ctunnel client is also usable through an API (for test integration, automation, etc)

ctunnel(port [,options][,callback])

Creates a new tunnel to the specified local port. Will return a Promise that resolves once you have been assigned a public url. options can be used to request a specific subdomain. A callback function can be passed, in which case it won't return a Promise. This exists for backwards compatibility with the old Node-style callback API. You may also pass a single options object with port as a property.

const ctunnel = require("ctunnel");

// Set server via environment variable (optional)
// process.env.CTUNNEL_SERVER = 'https://claude.ws';

(async () => {
  const tunnel = await ctunnel({
    port: 3000,
    api_key: 'ct_live_0123456789abcdef0123456789abcdef'
    // host: 'https://custom.server.com' // optional, overrides CTUNNEL_SERVER
  });

  // the assigned public url for your tunnel
  tunnel.url;

  tunnel.on("close", () => {
    // tunnels are closed
  });
})();

options

  • port (number) [required] The local port number to expose through the tunnel.
  • api_key (string) API key for tunnel server authentication. Format: ct_live_ + 32 hex characters.
  • subdomain (string) Request a specific subdomain on the proxy server. Note You may not actually receive this name depending on availability.
  • host (string) URL for the upstream proxy server. Defaults to CTUNNEL_SERVER env var or https://claude.ws.
  • local_host (string) Proxy to this hostname instead of localhost. This will also cause the Host header to be re-written to this value in proxied requests.
  • local_https (boolean) Enable tunneling to local HTTPS server.
  • local_cert (string) Path to certificate PEM file for local HTTPS server.
  • local_key (string) Path to certificate key file for local HTTPS server.
  • local_ca (string) Path to certificate authority file for self-signed certificates.
  • allow_invalid_cert (boolean) Disable certificate checks for your local HTTPS server (ignore cert/key/ca options).

Refer to tls.createSecureContext for details on the certificate options.

Tunnel

The tunnel instance returned to your callback emits the following events

| event | args | description | | ------- | ---- | ------------------------------------------------------------------------------------ | | request | info | fires when a request is processed by the tunnel, contains method and path fields | | error | err | fires when an error happens on the tunnel | | close | | fires when the tunnel has closed |

The tunnel instance has the following methods

| method | args | description | | ------ | ---- | ---------------- | | close | | close the tunnel |

Tunnel.release(subdomain, host, apiKey)

Static method to release (delete) a subdomain. This disconnects any active tunnel and releases the subdomain ownership.

const ctunnel = require("ctunnel");

(async () => {
  try {
    const result = await ctunnel.release(
      'myapp',
      'https://claude.ws',
      'ct_live_0123456789abcdef0123456789abcdef'
    );
    console.log(result); // { released: true, subdomain: 'myapp' }
  } catch (err) {
    console.error(err.message);
  }
})();

Parameters:

  • subdomain (string) [required] The subdomain to release
  • host (string) Tunnel server URL. Defaults to CTUNNEL_SERVER env var or https://claude.ws
  • apiKey (string) API key for authentication

Error responses: | Error Code | Description | |------------|-------------| | 401 | Authentication required | | 403 | You do not own this subdomain | | 404 | Subdomain not found |

Error Handling

The client handles authentication errors gracefully:

| Error Code | Description | |------------|-------------| | ERR_INVALID_API_KEY | API key is invalid or expired | | ERR_AUTH_UNAVAILABLE | Authentication service is unavailable |

License

MIT