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.
It is available on JSR:
deno add @hongminhee/localtunnel
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.
To be released.
Released on April 29, 2024.
- Added
exclude
option toTunnelOptions
interface. - Now
openTunnel()
automatically retries with another service if the first service fails.
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"]
.
Initial release. Released on April 26, 2024.