1

I am setting up a microservice. The code is working fine on localhost. To make it accessible to the other computers too I tried npm's localtunnel. Sometimes it used to give 404 error but it was working fine for straight 2 days. But suddenly It started giving 502 'tunnel server offline: Request failed with status code 502, retry 1s' error.

I uninstalled and re-installed localtunnel, Rechecked my code on localhost, To fix 502 error, I cleared the browser's cache and checked firewall status.

While setting up localtunnel I ran following commands on terminal:npm install -g localtunnel, lt --port 3002 --subdomain user, sudo npm install --save-dev forever.

I expect the output of lt --port 3002 --subdomain user to be 'your url is: https://user.localtunnel.me', but actual output is 'tunnel server offline: Request failed with status code 502, retry 1s'

2 Answers2

0

Seems like Localtunnel doesn't work anymore. I also got 502 trying to do a simple "lt --port 3000" command.

Looking for workarounds, I found ngrok (here). Downloaded it into some folder, opened a terminal in this folder and executed "./ngrok.exe https 3000" and it worked like a charm!

erezmk
  • 79
  • 8
0

I solved it this way.

The problem: Once you make your subdomain request, and then terminate it with Ctrl+c. It will terminate on the terminal but, the task still runs on the background. I solved it by going to task manager, and terminating all task that involve "HOST". After that, make your request again for subdomain. i.e, lt --port 3002 --subdomain mysubdomain

isofttechn
  • 400
  • 1
  • 6
  • 19