Crates.io | localtunnel-cli |
lib.rs | localtunnel-cli |
version | 0.0.3 |
source | src |
created_at | 2022-07-22 01:12:49.804821 |
updated_at | 2022-08-29 12:29:53.913534 |
description | A CLI to proxy with localtunnel server. |
homepage | |
repository | https://github.com/kaichaosun/rlt |
max_upload_size | |
id | 630216 |
size | 37,041 |
Localtunnel exposes your localhost endpoint to the world, user cases are:
Use in CLI:
cargo install localtunnel-cli
localtunnel-cli client --host https://localtunnel.me --subdomain kaichao --port 3000
Use as a Rust library:
cargo add localtunnel
use localtunnel::{open_tunnel, broadcast};
let (notify_shutdown, _) = broadcast::channel(1);
let result = open_tunnel(
Some("https://localtunnel.me"),
Some("kaichao"),
Some("locallhost"),
3000,
notify_shutdown.clone(),
)
.await
.unwrap();
// Shutdown the background tasks by sending a signal.
let _ = notify_shutdown.send(());