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

Rubber ducking this here. Latest version from npm, 1.9.0.

lt --port 80 --subdomain elijah --local-host "local.example.com" your url is: https://elijah.localtunnel.me /home/elijah/.config/fnm/lib/node_modules/localtunnel/bin/client:65 throw err; ^

Error: connection refused: localtunnel.me:44972 (check your firewall settings) at Socket.<anonymous> (/home/elijah/.config/fnm/lib/node_modules/localtunnel/lib/TunnelCluster.js:47:32) at Socket.emit (events.js:182:13) at emitErrorNT (internal/streams/destroy.js:82:8) at emitErrorAndCloseNT (internal/streams/destroy.js:50:3) at process._tickCallback (internal/process/next_tick.js:63:19)

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 26
  • Comments: 42 (2 by maintainers)

Most upvoted comments

@BerndErnst You may not have meant your comment to sound this way but it sounds unappreciative to me. This is a free service, the code is open source and we can spin up our own servers if we like and @defunctzombie doesn’t really owe anyone a high availability server or bandwidth.

That being said, I think the action item for this particular issue is to make the error message a bit better. I propose the message to simply be changed from > to:

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

Error: connection refused: localtunnel.me:44972 (check your firewall settings or server may be under high load, try again in a few minutes)

And maybe distinguish between an external connection refusal vs a firewall issue for isolated error messages.

I just used sudo and it is working

So the problem is that your antivirus firewall is blocking the connection, try temporary disabling it!

If you pass a subdomain name in then it will use the same one, e.g. lt --subdomain yellowtruck.

Getting the same error. Here’s an example log:

your url is: https://afraid-baboon-40.localtunnel.me
/usr/lib64/node_modules/localtunnel/bin/client:65
    throw err;
    ^

Error: connection refused: localtunnel.me:37161 (check your firewall settings)
at Socket.<anonymous> (/usr/lib64/node_modules/localtunnel/lib/TunnelCluster.js:47:32)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at emitErrorNT (internal/streams/destroy.js:64:8)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)

localtunnel.sh:

#!/bin/bash 
until lt --port 3000 --subdomain amga-monorepo-starter-api
do
  echo "Try again"
done

Example of how I use it in a project: https://github.com/AMGAVentures/monorepo-starter/blob/46d393a02033f325862c8e95451059d7efd3f34d/packages/api/package.json#L6

https://github.com/localtunnel/localtunnel/issues/261#issuecomment-407550521

I am glad to hear this project is useful! However, I must also note that this project is a low priority side project for me. I come back to it from time to time (this is why some issues get closed, etc) but generally I would not expect a fast response from me here.

For those that do find the project useful but suffer from the flaky public server; the server is open source https://github.com/localtunnel/server and I recommend that if you have serious needs you set it up yourself. The client has a command line argument to use other servers.

I will continue to run the public server and make small tweaks here or there if I desire - however I would not consider this project actively maintained.

tldr; The issue is that the server is overloaded, it is a side project, what community needs is someone who wants to step up and maintain a new server, and pay for it.

Same issue here. Why is the issue closed although the problem still exists?

Same issue on mac.

Retying several times helps, with request like: lt --port 80 --subdomain cool-api-project --local-host "localhost" -o --print-requests

Here’s a workaround with bash:

until npx lt <options>; do done

At the terminal, run npm install --save-dev forever

In your root project directory, create a new file called sendgrid_webhook.js . Add the following to that file:

var localtunnel = require(‘localtunnel’); localtunnel(5000, { subdomain: <YOUR_SUBDOMAIN> }, function(err, tunnel) { console.log(‘LT running’) }); Replace <YOUR_SUBDOMAIN> with the subdomain name you picked, so it should look something like

{ subdomain: ‘asdfasdf’ } In the package.json file, replace the “webhook” script with the following:

“webhook”: “forever sendgrid_webhook.js”

@pierrebonbon If you wait a minute and try again, repeat. You should eventually get a connection established.

The localtunnel server experiences times of high load and instability because it is a free public service. Often retrying (as suggested in the comments) helps.

If you need a reliable test server you can setup your own localtunnel server backed (see the server repo).

I reverted to localhost@1.8.3 and it started working again. 2.0 did not work for me.