localtunnel vs tunnel-rat vs ngrok
Tunneling Solutions for Local Development Comparison
1 Year
localtunneltunnel-ratngrok
What's Tunneling Solutions for Local Development?

Tunneling solutions are essential tools for web developers that allow them to expose local servers to the internet. These tools create secure tunnels from a local development environment to a public URL, enabling developers to share their work with clients or collaborators without deploying to a live server. Each tunneling solution offers unique features, performance characteristics, and ease of use, making them suitable for different use cases in local development workflows.

Package Weekly Downloads Trend
Github Stars Ranking
Stat Detail
Package
Downloads
Stars
Size
Issues
Publish
License
localtunnel594,84220,195-1583 years agoMIT
tunnel-rat248,83939226.4 kB82 years agoMIT
ngrok141,8402,34923.3 MB412 years agoBSD-2-Clause
Feature Comparison: localtunnel vs tunnel-rat vs ngrok

Ease of Use

  • localtunnel:

    Localtunnel is extremely easy to set up and use. You simply install it via npm and run a single command to expose your local server. It does not require any configuration or account, making it perfect for quick tests and demos.

  • tunnel-rat:

    Tunnel Rat is designed to be straightforward, but it may require some initial configuration depending on your environment. It is less user-friendly than Localtunnel but offers flexibility for users who prefer customization.

  • ngrok:

    Ngrok requires a bit more setup, including creating an account and installing the client. However, once set up, it provides a user-friendly interface and command-line options that are intuitive for developers familiar with terminal commands.

Features and Functionality

  • localtunnel:

    Localtunnel provides basic functionality for exposing local servers but lacks advanced features like authentication or detailed logging. It is best for quick sharing rather than long-term use or production scenarios.

  • tunnel-rat:

    Tunnel Rat focuses on simplicity and lightweight operation, providing essential tunneling features without the bloat. It is suitable for developers looking for a minimalistic approach without extensive features.

  • ngrok:

    Ngrok offers a rich set of features, including custom subdomains, request inspection, and the ability to replay requests. This makes it suitable for debugging and testing APIs, as well as for more secure sharing of local applications.

Security

  • localtunnel:

    Localtunnel does not provide built-in security features like authentication or encryption, which may expose your local server to risks. It is best used in trusted environments or for short-term sharing.

  • tunnel-rat:

    Tunnel Rat offers basic security features, but users must implement their own security measures. It is less secure than Ngrok but can be configured for secure use depending on the developer's needs.

  • ngrok:

    Ngrok emphasizes security, offering features like password protection and HTTPS tunnels. This makes it a better choice for sharing sensitive applications or APIs that require secure access.

Performance

  • localtunnel:

    Localtunnel may experience latency issues and is not optimized for high-performance scenarios. It is suitable for light usage but may not handle heavy traffic well.

  • tunnel-rat:

    Tunnel Rat's performance is generally good for local development, but it may not match the performance of Ngrok in high-traffic situations. It is best for individual developers or small teams.

  • ngrok:

    Ngrok is known for its reliable performance and speed, even under load. It is optimized for production-like scenarios and can handle multiple connections efficiently.

Cost

  • localtunnel:

    Localtunnel is completely free to use, making it an attractive option for developers on a budget or those who need quick, temporary solutions.

  • tunnel-rat:

    Tunnel Rat is open-source and free to use, appealing to those who prefer self-hosted solutions without ongoing costs.

  • ngrok:

    Ngrok offers a free tier with limited features, but advanced features and higher usage limits require a paid plan. This can be a consideration for developers needing extensive functionality.

How to Choose: localtunnel vs tunnel-rat vs ngrok
  • localtunnel:

    Choose Localtunnel if you need a simple, no-setup solution for exposing your local server quickly. It is easy to use and requires no account or configuration, making it ideal for quick demos or testing.

  • tunnel-rat:

    Choose Tunnel Rat if you want a lightweight solution that can be easily integrated into your development workflow, especially if you prefer a self-hosted option. It is useful for developers who want to maintain control over their tunneling setup.

  • ngrok:

    Choose Ngrok if you require advanced features such as custom subdomains, password protection, and detailed request inspection. Ngrok is suitable for more complex use cases where security and monitoring are important.

README for localtunnel

localtunnel

localtunnel exposes your localhost to the world for easy testing and sharing! No need to mess with DNS or deploy just to have others test out your changes.

Great for working with browser testing tools like browserling or external api callback services like twilio which require a public url for callbacks.

Quickstart

npx localtunnel --port 8000

Installation

Globally

npm install -g localtunnel

As a dependency in your project

yarn add localtunnel

CLI usage

When localtunnel is installed globally, just use the lt command to start the tunnel.

lt --port 8000

Thats it! It will connect to the tunnel server, setup the tunnel, and tell you what url to use for your testing. This url will remain active for the duration of your session; so feel free to share it with others for happy fun time!

You can restart your local server all you want, lt is smart enough to detect this and reconnect once it is back.

Arguments

Below are some common arguments. See lt --help for additional arguments

  • --subdomain request a named subdomain on the localtunnel server (default is random characters)
  • --local-host proxy to a hostname other than localhost

You may also specify arguments via env variables. E.x.

PORT=3000 lt

API

The localtunnel client is also usable through an API (for test integration, automation, etc)

localtunnel(port [,options][,callback])

Creates a new localtunnel to the specified local port. Will return a Promise that resolves once you have been assigned a public localtunnel url. options can be used to request a specific subdomain. A callback function can be passed, in which case it won't return a Promise. This exists for backwards compatibility with the old Node-style callback API. You may also pass a single options object with port as a property.

const localtunnel = require('localtunnel');

(async () => {
  const tunnel = await localtunnel({ port: 3000 });

  // the assigned public url for your tunnel
  // i.e. https://abcdefgjhij.localtunnel.me
  tunnel.url;

  tunnel.on('close', () => {
    // tunnels are closed
  });
})();

options

  • port (number) [required] The local port number to expose through localtunnel.
  • subdomain (string) Request a specific subdomain on the proxy server. Note You may not actually receive this name depending on availability.
  • host (string) URL for the upstream proxy server. Defaults to https://localtunnel.me.
  • local_host (string) Proxy to this hostname instead of localhost. This will also cause the Host header to be re-written to this value in proxied requests.
  • local_https (boolean) Enable tunneling to local HTTPS server.
  • local_cert (string) Path to certificate PEM file for local HTTPS server.
  • local_key (string) Path to certificate key file for local HTTPS server.
  • local_ca (string) Path to certificate authority file for self-signed certificates.
  • allow_invalid_cert (boolean) Disable certificate checks for your local HTTPS server (ignore cert/key/ca options).

Refer to tls.createSecureContext for details on the certificate options.

Tunnel

The tunnel instance returned to your callback emits the following events

| event | args | description | | ------- | ---- | ------------------------------------------------------------------------------------ | | request | info | fires when a request is processed by the tunnel, contains method and path fields | | error | err | fires when an error happens on the tunnel | | close | | fires when the tunnel has closed |

The tunnel instance has the following methods

| method | args | description | | ------ | ---- | ---------------- | | close | | close the tunnel |

other clients

Clients in other languages

go gotunnelme

go go-localtunnel

C#/.NET localtunnel-client

server

See localtunnel/server for details on the server that powers localtunnel.

License

MIT