localtunnel / localtunnel

expose yourself
https://localtunnel.me
MIT License
18.88k stars 1.32k forks source link

Server keeps on disconnecting #388

Open Eden4897 opened 3 years ago

Eden4897 commented 3 years ago

I always get this error around a few hours/days after I host my bot:

Error: connection refused: localtunnel.me:38261 (check your firewall settings)

Is there a way to fix this problem? I did some research and saw that it was because of bad connectivity of the localtunnel servers. Is there anyway I can listen to this error or catch this error and reconnect to localtunnel after this? It has been an hassle trying to sort this out and have caused a lot of problems. Thanks.

xianingz commented 3 years ago

I'm using this https://github.com/kirillshevch/localtunnel-restarter. It automatically reconnects when there are connection issues.

Marvin-Brouwer commented 6 months ago

If this happens sporadically, while already running, his may just be a connection hickup. There's a PR open with a retry policy: #311. Maybe you can upvote it to bring it to the maintainers attention?

squatica commented 5 months ago

I'm also experiencing occasional connection refused - I establish the tunnel fine, everything works for a couple of hours, suddenly a wild connection refused error appears and then it hangs. I found that it tries to start a new tunnel, but it waits forever on the axios request to get the assigned url. My solution is adding a 5s timeout to that axios call: #646

Marvin-Brouwer commented 5 months ago

Hmm, by now I've built my own implementation that doesn't rely on axios. I just tried adding the timeout for the fun of it but it fails. I think the issue may actually reside in either the docker image, nginx, or the dev warning page. When I run the same code against a locally hosted /localtunnel/server@v0.0.8 it works fine.