Skip to main content
Home

Built and signed on GitHub Actions

A simple wrapper around the local tunneling services

This package works with DenoIt is unknown whether this package works with Node.js, Bun
It is unknown whether this package works with Node.js
This package works with Deno
It is unknown whether this package works with Bun
JSR Score
94%
Published
a year ago (0.2.0)

localtunnel

JSR

This Deno module is a simple wrapper around the local tunneling services. Currently it supports localhost.run and serveo.net. The module is designed to be simple to use and to provide a consistent interface to both services.

Installation

It is available on JSR:

deno add @hongminhee/localtunnel

Usage

Invoke the openTunnel() function to open a tunnel to a local port. The function returns a promise that resolves to a Tunnel object. The Tunnel object has a url property that contains the URL of the tunnel. The Tunnel object also has a close() method that closes the tunnel:

const tunnel = await openTunnel({ port: 8000 });
console.log(tunnel.url.href);
alert("Press Enter to close the tunnel.");
await tunnel.close();

For more information, see the API documentation.

Changelog

Version 0.2.0

Released on April 29, 2024.

  • Added exclude option to TunnelOptions interface.
  • Now openTunnel() automatically retries with another service if the first service fails.

Version 0.1.1

Released on April 28, 2024.

  • Fixed a bug in openTunnel() that breaks standard input on Windows.
  • Improved error handling in openTunnel().
  • Added log messages using LogTape. The log category is ["localtunnel"].

Version 0.1.0

Initial release. Released on April 26, 2024.

Built and signed on
GitHub Actions

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@hongminhee/localtunnel

Import symbol

import * as localtunnel from "@hongminhee/localtunnel";
or

Import directly with a jsr specifier

import * as localtunnel from "jsr:@hongminhee/localtunnel";

Add Package

pnpm i jsr:@hongminhee/localtunnel
or (using pnpm 10.8 or older)
pnpm dlx jsr add @hongminhee/localtunnel

Import symbol

import * as localtunnel from "@hongminhee/localtunnel";

Add Package

yarn add jsr:@hongminhee/localtunnel
or (using Yarn 4.8 or older)
yarn dlx jsr add @hongminhee/localtunnel

Import symbol

import * as localtunnel from "@hongminhee/localtunnel";

Add Package

vlt install jsr:@hongminhee/localtunnel

Import symbol

import * as localtunnel from "@hongminhee/localtunnel";

Add Package

npx jsr add @hongminhee/localtunnel

Import symbol

import * as localtunnel from "@hongminhee/localtunnel";

Add Package

bunx jsr add @hongminhee/localtunnel

Import symbol

import * as localtunnel from "@hongminhee/localtunnel";