Coder Social home page Coder Social logo

rlt's Introduction

Localtunnel

localtunnel localtunnel-client localtunnel-server

Localtunnel exposes your localhost endpoint to the world, user cases are:

  • API testing
  • multiple devices access to single data store
  • peer to peer connection, workaround for NAT hole punching.

Client Usage

Known issue: the public proxy server is down, please setup your own server.

Use in CLI:

cargo install localtunnel

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

Use as a Rust library:

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(());

Server Usage

Use in CLI:

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

Use as a Rust library,

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?

Sponsor

Please help me build OSS ๐Ÿ‘‰ GitHub Sponsors

Resources

rlt's People

Contributors

akhildevelops avatar kaichaosun avatar krystex avatar marinpostma avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.