Giter Site home page Giter Site logo

localtunnel.net's Introduction

localtunnel-client

.NET implementation of a tunnel client for localtunnel.me.

Installation

You can install localtunnel-client using one of the followings ways:

  1. Install localtunnel-client as a dotnet global tool using: dotnet tool install localtunnel.cli --global
  2. Use the latest release from the release page and put the folder in your PATH.

Getting Started

Let's get started with starting up a simple tunnel. In the following command, we open a proxy tunnel with a custom subdomain name (my-subdomain) and proxy requests to example.com (HTTPS).

localtunnel --subdomain my-subdomain --host example.com --port 443 https

Features

Open Webbrowser

If you are developing a web application or something else, you can put the --browser option onto your command and the client will open your browser with the subdomain.

Dashboard

The client records all recent connections made and shows where they pointed at. You can also disable the dashboard if needed.

HTTP header manipulation

The client fetches HTTP headers during the request and transforms the Host header to point onto the target domain to emulate a real proxy. If you want to disable this to make a passthrough proxy, specify the --passthrough option.

CLI

You can change the options as you need. Here is a list of options the client offers:

Usage:
  Localtunnel [options] [command]

Options:
  -v, --verbose                                  Enables detailed verbose output.
  -b, --browser                                  If specified, opens the webpage in the browser.
  --no-dashboard                                 If specified, disables the dashboard.
  -c, --max-connections <max-connections>        The number of maximum allowed connections. [default: 10]
  -d, --subdomain <subdomain>                    The name of the subdomain to use, if not specified a random subdomain
                                                 name is used.
  -s, --server <server>                          The hostname of the server to use. [default: https://localtunnel.me/]
  -h, --host <host>                              The host to proxy requests to. [default: localhost]
  -p, --port <port>                              The port to proxy requests to. [default: 80]
  --receive-buffer-size <receive-buffer-size>    The minimum number of bytes to use for the receive buffer. [default:
                                                 65536]
  --passthrough                                  If specified, the request is proxied as received and no HTTP headers
                                                 are reinterpreted. [default: False]
  --version                                      Show version information
  -?, -h, --help                                 Show help and usage information

Commands:
  http     Starts a tunnel that exposes a HTTP server.
  https    Starts a tunnel that exposes a HTTPS server.

Using as a library

You can use localtunnel-client as a .NET library. The following code demonstrates how to create a secured tunnel:

using System.Threading.Tasks;
using Localtunnel;
using Localtunnel.Connections;

using var client = new LocaltunnelClient();
var options = new ProxiedSslTunnelOptions { };

var tunnel = await client.OpenAsync(
    connectionFactory: x => new ProxiedSslTunnelConnection(x, options),
    subdomain: "my-domain");

await Task.Delay(-1);

Additional notes

If you use a self-signed certificate for SSL, you can pass the --allow-untrusted-certificates option AFTER the https verb to bypass the SSL verification.

After May 11, 2021 localtunnel-client was split into two separate assemblies (see: #4), if you installed localtunnel-client before that, you can run the following to upgrade:

dotnet tool uninstall localtunnel --global
dotnet tool install localtunnel.cli --global

Motivation

I have created this implementation because I would not say I liked localtunnel's implementation:

  • It does not offer an option to open the browser.
  • It is no longer actively maintained.
  • It requires NodeJS to run. You can compile this client to a single file executable.
  • It needs a HUGE amount of resources idle that are unnecessary.

localtunnel.net's People

Contributors

angelobreuer avatar igelkottegrodan avatar lordofdoom 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.