https://github.com/dahlia/localtunnel
A simple wrapper around the local tunneling services
https://github.com/dahlia/localtunnel
Last synced: 8 months ago
JSON representation
A simple wrapper around the local tunneling services
- Host: GitHub
- URL: https://github.com/dahlia/localtunnel
- Owner: dahlia
- License: mit
- Created: 2024-04-26T05:41:37.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-07T03:39:55.000Z (over 1 year ago)
- Last Synced: 2025-01-03T14:28:38.475Z (9 months ago)
- Language: TypeScript
- Size: 22.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
localtunnel
===========[![JSR][JSR badge]][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.[JSR]: https://jsr.io/@hongminhee/localtunnel
[JSR badge]: https://jsr.io/badges/@hongminhee/localtunnel
[localhost.run]: https://localhost.run/
[serveo.net]: https://serveo.net/Installation
------------It is available on [JSR]:
~~~~ console
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:~~~~ typescript
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][JSR].
[`openTunnel()`]: https://jsr.io/@hongminhee/localtunnel/doc/~/openTunnel
[`Tunnel`]: https://jsr.io/@hongminhee/localtunnel/doc/~/Tunnel
[`url`]: https://jsr.io/@hongminhee/localtunnel/doc/~/Tunnel.url
[`close()`]: https://jsr.io/@hongminhee/localtunnel/doc/~/Tunnel.closeChangelog
---------### Version 0.3.0
To be released.
### 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"]`.[LogTape]: https://github.com/dahlia/logtape
### Version 0.1.0
Initial release. Released on April 26, 2024.