#proxy-server #api-testing #peer-connection #data-store #devices #nat #expose

app localtunnel

用于与 localtunnel 服务器代理的命令行界面 (CLI)

16 个版本

0.1.3 2024 年 5 月 22 日
0.1.2 2023 年 6 月 3 日
0.1.1 2023 年 4 月 24 日
0.1.0 2023 年 2 月 27 日
0.0.8 2022 年 7 月 22 日

网络编程 中排名第 1128

Download history 128/week @ 2024-05-17 22/week @ 2024-05-24 2/week @ 2024-05-31 6/week @ 2024-06-07 3/week @ 2024-06-14 11/week @ 2024-07-05 63/week @ 2024-07-26 7/week @ 2024-08-02

每月下载量 70
localtunnel-cli 中使用

MIT 许可证

48KB
738

Localtunnel

localtunnel localtunnel-client localtunnel-server

Localtunnel 将您的 localhost 端点暴露给世界,用例包括

  • API 测试
  • 多设备访问单个数据存储
  • 点对点连接,NAT 穿洞的解决方案。

客户端使用

已知问题:公共代理服务器已关闭,请设置您自己的服务器。

在 CLI 中使用

cargo install localtunnel

localtunnel client --host https://init.so --subdomain kaichao --port 3000

作为 Rust 库使用

cargo add localtunnel-client
use localtunnel_client::{open_tunnel, broadcast, ClientConfig};

let (notify_shutdown, _) = broadcast::channel(1);

let config = ClientConfig {
    server: Some("https://init.so".to_string()),
    subdomain: Some("demo".to_string()),
    local_host: Some("localhost".to_string()),
    local_port: 3000,
    shutdown_signal: notify_shutdown.clone(),
    max_conn: 10,
    credential: None,
};
let result = open_tunnel(config).await?;

// Shutdown the background tasks by sending a signal.
let _ = notify_shutdown.send(());

服务器使用

在 CLI 中使用

localtunnel server --domain init.so --port 3000 --proxy-port 3001 --secure

作为 Rust 库使用,

cargo install localtunnel-server
use localtunnel_server::{start, ServerConfig};

let config = ServerConfig {
    domain: "init.so".to_string(),
    api_port: 3000,
    secure: true,
    max_sockets: 10,
    proxy_port: 3001,
    require_auth: false,
};

start(config).await?

赞助

请帮助我构建 OSS 👉 GitHub Sponsors

资源

依赖项

~22–37MB
~692K SLoC