I have a server that runs via Node on my machine. It runs when my pc starts up under a custom subdomain using lt --subdomain mydomain --port 3000 I noticed that it started to randomly crash after about 6 hours. I put this down to either the node server or localtunnel restarting or my internet being poor quality.
When i rerun the above localtunnel command it says the subdomain is taken (gives a random subdomain). How do I make the localtunnel close the tunnel correctly to allow for my subdomain to be reused?
I've managed to make a class that redigs/restarts the tunnel if a connection error occurs. It is not a fix to the problem, but it prevents it from occuring. I've been using this as a solution for a year now and haven't had a single problem with it, so I hope it works for you too.
easy-tunnel.jsmain-app.js