ngrok icon indicating copy to clipboard operation
ngrok copied to clipboard

ngrok randomly doesn't work until access to localhost:4040

Open zcmgyu opened this issue 6 years ago • 10 comments

Code:

const url = await ngrok.connect({
        proto: 'http',
        addr: 4723,
        region: 'ap',
        binPath: this.binPath, // custom binary path, eg for prod in electron
      });

Error: {"errno":"ECONNREFUSED","code":"ECONNREFUSED","syscall":"connect","address":"127.0.0.1","port":4041}

Description: In this case, if I don't access into localhost:4040, ngrok doesn't allow create a tunnel.

zcmgyu avatar Feb 26 '19 09:02 zcmgyu

I'm getting the same. ngrok has been the reason my intermittent failed Travis builds lately

miguelduarte42 avatar Mar 08 '19 11:03 miguelduarte42

FYI, i had this same issue, i tracked it down to a bad auth token. I launched ngrok via the command line and it responded with invalid token, I don't think those errors bubble up.

trevorlinton avatar Mar 25 '19 18:03 trevorlinton

In my case I found out today that I was creating a second connection on a different machine, while my subscription only allows for one.

Trevor Linton [email protected] escreveu em seg, 25/03/2019 às 18:44 :

FYI, i had this same issue, i tracked it down to a bad auth token. I launched ngrok via the command line and it responded with invalid token, I don't think those errors bubble up.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bubenshchykov/ngrok/issues/138#issuecomment-476328864, or mute the thread https://github.com/notifications/unsubscribe-auth/ABi1bqBWBSR2ZObHKbnVjh7xFRE4wA0fks5vaRkPgaJpZM4bRuTx .

miguelduarte42 avatar Mar 25 '19 21:03 miguelduarte42

My workaround is use fetch api to request to localhost:4040 and retry again.

zcmgyu avatar Apr 04 '19 09:04 zcmgyu

@miguelduarte42 did your recent PR fix this issue? try latest ngrok from npm

bubenshchykov avatar Jul 17 '19 21:07 bubenshchykov

@bubenshchykov

New error appears

VM1379:64 Error: connect ECONNREFUSED 127.0.0.1:4041 at TCPConnectWrap.afterConnect [as oncomplete]

zcmgyu avatar Sep 24 '19 06:09 zcmgyu

Having the exact same error as @zcmgyu above Didn't have this issue last week. 🤔 I'm on ngrok v3.2.5 on macOS Mojave

ChristopherDrum avatar Nov 01 '19 07:11 ChristopherDrum

I don't know the reason but I also got the same issue from one day to another (v3.2.5). Generating a new token in my ngrok dashboard was not enough. The solution was to create a new account (and a new token ofc) and use that token.

I guess my account got locked for some reason, without giving me a proper error message or info on my dashboard. Hope this helps someone else!

calsal8 avatar Nov 05 '19 13:11 calsal8

As well as you know,billing plan PRO can be reach the other port 80 ,its too expensive when your needed just to partice project up !

Beelucky avatar Sep 04 '20 20:09 Beelucky

I just had this issue and went into to Ngrok and shutdown the tunnel agent which fixed it for me.

I think this feature is still in beta and you have to request access through your dashboard https://dashboard.ngrok.com/tunnel-agents/sessions

gilesbutler avatar Sep 20 '21 07:09 gilesbutler