মূল কনটেন্টে যান
Localtonet Localtonet ড্যাশবোর্ড

এই পেজ এখনো বাংলা ভাষায় নেই। ইংরেজিতে দেখানো হচ্ছে।

Create an HTTP tunnel

এই পাতার সহায়তা
এই পেজে 10 সেকশন
  1. Before you start
  2. Steps
  3. Open the HTTP page
  4. Choose the URL type
  5. Choose the device and the region
  6. Enter the local address
  7. Start the tunnel
  8. Your public address
  9. HTTPS and certificates
  10. The Host header
  11. Settings of an HTTP tunnel
  12. Examples
  13. Share a web app
  14. Receive webhooks
  15. The warning page on the Free plan
  16. Troubleshooting
  17. Related pages

An HTTP tunnel gives a web app, an API or a webhook receiver on your device a public HTTPS address. Localtonet provides the certificate, so your local service can stay on plain HTTP.

Before you start #

  • The Localtonet client is installed on the device and connected with an AuthToken. If it is not, follow the Quick start.
  • Your web service is running and you know its port, for example 3000.
  • For Custom subdomain or Custom domain: Balance on your account. For Custom domain also a domain that you added in DNS Manager. See Custom domains.

Steps #

  1. Open the HTTP page #

    Open My Tunnels › HTTP and select Create HTTP Tunnel to open the form.

  2. Choose the URL type #

    URL typeAddress you getNeeds
    Random subdomainA generated name on the selected domain, for example https://<RANDOM_NAME>.localto.net.Nothing extra
    Custom subdomainThe name you type in Subdomain, for example https://myapp.localto.net. Letters, digits and hyphens are allowed.Balance
    Custom domainA domain of your own, selected in Domain.Balance and a domain in DNS Manager
  3. Choose the device and the region #

    In Device token, select the token used by the Localtonet app on your device. In Server region, choose a region close to your device for lower latency.

  4. Enter the local address #

    FieldWhat to enter
    Domainlocalto.net, or one of your own domains. For Custom domain the list only contains your own domains.
    SubdomainOnly for Custom subdomain: the name in front of the domain.
    Local IP addressAddress of the service on your device. Use 127.0.0.1 for this device. The form accepts an IPv4 or IPv6 address or localhost.
    Local portThe port your local service listens on, from 1 to 65535.

    Select Create tunnel. The tunnel appears under Your tunnels as Tunnel # followed by its ID.

  5. Start the tunnel #

    Select the start button in the Actions column. When the tunnel runs, its address in the URL column becomes a link. Open it in a browser. Requests to that address now reach the service on your device.

    If the Localtonet app of that token is offline, a dialog tells you so. Start the app, or select Start anyway and the tunnel goes live when the app connects.

Your public address #

  • The address is https:// followed by the host name in the URL column.
  • An HTTP tunnel keeps its subdomain until you delete the tunnel. Stopping and starting does not change it.
  • The address has no port number. Visitors open it like any other website.
  • WebSocket connections pass through an HTTP tunnel.

HTTPS and certificates #

Visitors reach an HTTP tunnel over HTTPS with a certificate that Localtonet provides and renews. TLS ends at the Localtonet server. From there the request travels through the tunnel to your device, and the Localtonet app passes it to your service.

SettingWhat it doesWhen to use it
Is Only Https?Serves the public URL over HTTPS only. A request to http:// is redirected to the same address on https://. While it is off, the address answers on both.Turn it on for anything that carries logins or private data.
Is HTTP/3 Active?Lets clients reach the public URL over HTTP/3. A new tunnel has it turned on.Turn it off only if a client has trouble with HTTP/3.
Is SslStream?Tells the Localtonet app to connect to your local service with TLS. The app accepts the certificate of the local service as it is, so a self-signed certificate works.Turn it on when your local service itself uses HTTPS, for example a dev server on https://localhost:5001.
Legacy Connect?Connects the tunnel with the legacy method instead of the normal one.Try this if the tunnel cannot connect with the normal method.

You find these switches under Settings in the Tunnel settings panel. Changing Is SslStream? or Legacy Connect? on a running tunnel restarts it, so the Localtonet app must be connected.

Need encryption up to your own service? With an HTTP tunnel, Localtonet decrypts the traffic at its server. Use a TLS tunnel when your service must present its own certificate.

The Host header #

Your service receives the host name the visitor used, which is the tunnel address. Some local web servers pick the site by host name and answer with the wrong site or an error. In that case open Headers in the tunnel settings and add a request header named Host with the name your server expects. Your service then receives this host name instead of the tunnel address. See Headers and rewrites and Virtual hosts.

Settings of an HTTP tunnel #

Select the settings button in the Actions column to open the Tunnel settings panel. Under Tunnel Details you can rename the tunnel and change the local IP address and the local port. The table lists what else an HTTP tunnel offers and where it is explained.

SettingWhat it doesRead more
Load BalanceDistribute traffic across devices or use a backup target.Load balancing
Show SSH CommandStart this tunnel with plain SSH, without installing the Localtonet app.Zero-install SSH
Is Only Https?, Is HTTP/3 Active?, Is SslStream?, Legacy Connect?How visitors and your service connect.This page, above
Rewrite Path?Change the request path before it reaches your local service.Headers and rewrites
HeadersManage custom HTTP request and response headers for this tunnel.Headers and rewrites
HTTP TimeoutSet how long the server waits for a response from your local application, from 1 to 600 seconds.Headers and rewrites
Basic Authentication?Ask visitors for a username and password.Access control
IP RestrictionControl which client IP addresses can access this tunnel.Access control
SSO ProvidersVisitors sign in with one of your identity providers before they can open the tunnel. The SSO button at the top of the page manages the providers.Single Sign-On
WAF button in the Actions columnOpens WAF Setting. The button shows whether the Web Application Firewall is not configured, active or inactive.Web Application Firewall
Expiration Date, Speed Limits, Bandwidth Limit, Bandwidth Usage, Bandwidth TrafficStop the tunnel on a date, cap its speed, cap its data, reset the data counter, and see the traffic over time.Limits and expiration
Request Log, Activity Log, Tunnel HealthInspect requests, review starts, stops and setting changes, and see the health checks.Logs and inspection
ArgumentsSend this tunnel through a specific network on your device.Network selection
Outbound PortUse fixed outbound ports for the Localtonet app's server connection, for strict firewalls.Ports
Tunnel NoteSave a private note to help you identify this tunnel.Settings reference

SSO Providers is not shown for a tunnel that belongs to a team.

Examples #

Share a web app #

Your app runs on the same computer as the Localtonet client and listens on port 3000.

FieldValue
URL typeRandom subdomain
Domainlocalto.net
Local IP address127.0.0.1
Local port3000

Create the tunnel, start it and send the address from the URL column to the people who should see the app. To ask them for a password first, turn on Basic Authentication?.

If the app runs on another machine in your network, enter that machine's address in Local IP address, for example 192.168.1.20. The device that runs the Localtonet client must be able to reach it.

Receive webhooks #

A webhook provider needs a public HTTPS address to send events to. Create an HTTP tunnel to the port of your receiver, start it, and enter the tunnel address plus the path of your endpoint at the provider:

Webhook URL
https://<YOUR_SUBDOMAIN>.localto.net/<YOUR_WEBHOOK_PATH>

Test it from any computer:

Terminal
curl -X POST https://<YOUR_SUBDOMAIN>.localto.net/<YOUR_WEBHOOK_PATH> \
  -H "Content-Type: application/json" \
  -d '{"event":"test"}'

To see what arrived, select the icon in the Webhooks column of the tunnel (View request & response logs). The tunnel must be started first. See Logs and inspection.

On the Free plan, add Balance before you rely on webhooks. Requests to an HTTP tunnel of a Free account get a warning page first, and a webhook provider cannot click through it. See the next section.

The warning page on the Free plan #

When an account has no Balance, a first-time visitor of its HTTP tunnel sees a Localtonet page titled "You are about to navigate to:" with the buttons Cancel and Visit Site. The page is there to deter misuse. Visit Site stores a cookie in the visitor's browser and opens your site. While the browser keeps that cookie, it is not asked again.

The page itself names the two ways to remove it:

  • Send a request header named localtonet-skip-warning with any value. This suits your own scripts and API clients.
  • Add Balance to your account. See Plans and Balance.
Terminal
curl -H "localtonet-skip-warning: 1" https://<YOUR_SUBDOMAIN>.localto.net/

Troubleshooting #

The dialog says the token is offline, or I get "The Localtonet app for AuthToken … is not connected."

The Localtonet client that uses this tunnel's token is not running or cannot reach Localtonet. Start the client on the device with the same token. The dialog starts the tunnel by itself as soon as the app connects. With Start anyway the tunnel is turned on and goes live later.

"Start or update the Localtonet app."

The tunnel could not be started on the device. Make sure the client is running, and install the current version from the Downloads page if it is old.

The browser shows "Tunnel Recently Started or Stopped"

The request reached Localtonet, but the tunnel is not accepting connections. The tunnel was just started or is stopped. Check that it is started and that the Connection column shows ON, then reload the page.

The browser shows a Localtonet error page that names my local address

The page says that traffic was tunneled to the Localtonet agent, but the agent failed to connect to the upstream service at your local IP and port. The heading is the error, for example ConnectionRefused. Nothing is listening at that address. Start your service, then check the local IP address and the local port under Tunnel Details. You can test the service on the device itself by opening the local address in a browser.

"You need to purchase balance to use this feature."

Custom subdomain and Custom domain need Balance. Use Random subdomain, or add Balance under Balance.

"You need a total balance of … to create another tunnel of this type."

Your Balance does not cover another tunnel. On the Free plan you can create only one tunnel in total, regardless of its type. Delete your existing tunnel before creating another, or add Balance.

"… already exists." or "… is not allowed."

Another tunnel uses that subdomain, or the name is reserved by Localtonet. Choose a different subdomain.

"WARNING! You do not have any Domain!"

You chose Custom domain but have not added a domain yet. Add it in DNS Manager first. If you see "… is already used by another tunnel.", that domain already belongs to one of your tunnels. A custom domain can serve one tunnel.

"Update the bandwidth limit or clear the bandwidth usage." or "Update the expiration date."

The tunnel reached its own bandwidth limit or its expiration date and cannot start. Change the limit or the date in the tunnel settings, or reset the counter with Bandwidth Usage. See Limits and expiration.

"Check the device connection."

You changed a setting that restarts a running tunnel while the Localtonet app was offline. Connect the app and save the setting again, or stop the tunnel first.

My app answers with the wrong site, or builds http:// links and redirects

Your app decides by the host name or the scheme it receives. Under Headers, add a Host request header if the app expects a fixed host name. Add an X-Forwarded-Proto request header with the value https to tell the app that visitors use HTTPS, so it builds https:// links and redirects.

সাপোর্ট