Localtunnel is not setting up the requested subdomain from the command 'lt --port 4000 --subdomain xyz'

9.8k Views Asked by At

I have been trying to set the subdomain in localtunnel, but it keeps throwing me different subdomains.

Port number is 4000 and it's running.

The command which I used : lt --port 4000 --subdomain xyz (I changed subdomain name for the security reason).

Where am I doing wrong?

2

There are 2 best solutions below

0
On BEST ANSWER

I know it is a very late answer, but for the help of others searchers who get to this link, and are not able to find a valid answer, for those users I am writing this answer

The command which I used : lt --port 4000 --subdomain xyz (I changed subdomain name for the security reason).

The first thing is that the command is ok but before local tunnel assigns you a subdomain it must be available first.

Now you may be thinking that I am using a private very unique domain name which should have available, yes you are right but remember local tunnel keeps the record of subdomains provided by you and builds his private database which contains enough pool for random subdomain assigning feature.

Which now clears that after one, two or even more (non-consecutive) attempts it is possible that your domain assigned to someone else so that for that period you can obviously not use that domain, however whenever that domain will be freed, you will be assigned the requested domain for sure.

2
On

I'm not familiar enough with localtunnel to tell you what's wrong there, but I can tell you how to accomplish your same goal using Telebit:

(p.s. Did you figure this out? If so, I'd love to hear how you did it and I'm sure others would too)

Install

curl https://get.telebit.io | bash

You can also install via npm... but that isn't the preferred install method at this time. There may be some caveats.

The random domain you get is attached to your account (hence the need for email) and it's encrypted end-to-end with Greenlock via Let's Encrypt.

Configure

./telebit http 4000 xyz

The general format is

./telebit <protocol> <port> [subdomain]

It's not just https, you can use it to tunnel anything over tls/ssl (plain tcp, ssh, openvpn, etc).

Custom domains are not yet a generally available feature, but they're on the horizon.