DEV Community

Discussion on: How to make your localhost accessible to the internet with ngrok

Collapse
 
jesse1981 profile image
Jesse Bryant

This is not localhost tunneling. Just because you can access it locally doesn't mean anyone else can - even with this application.

It is only putting a sub domain to your public IP address. It is no different than if you were to give your friend your address being xxx.xxx.xxx.xxx/ to access it from your machine.

That isn't to say these applications aren't useful, to give you a fixed domain to an IP that changes each time you establish your connection.

Collapse
 
nk2303 profile image
Ngan Kim Khong

Oh, no? I thought anyone would have access to it, a third party app probably have, if I allow it running. I probably have to edit my note a little. I forgot to mention that the access only available for an amount of time. Thanks for the input! :)

Collapse
 
steventhan profile image
Steven Than

This is not localhost tunneling

Can you elaborate on this? ngrok is a tunneling tool which maintain a long-lived tcp connection between client (where the localhost lives) and ngrok's server, did I miss something?

It is only putting a sub domain to your public IP address

No, there's no public IP address on the user side here, only the ones ngrok manages

Collapse
 
jesse1981 profile image
Jesse Bryant

Sorry, I think there is still some confusion here;

Even if you uninstall ngrok, you always have a public IP address. You can google "whatsmyip" and it will show it to you, and you can use this address to go to the website being served from your machine.

Thread Thread
 
steventhan profile image
Steven Than

I'm aware each machine connecting to the internet has its own public IP address, but how is it relevant to this post?

When I said:

there's no public IP address on the user side here

I meant ngrok doesn't simply assign a sub domain to the machine's public IP address, it opens a tcp connection and keep it alive using a heartbeat mechanism . This is localhost tunneling in my book. By doing this, ngrok doesn't care if a machine's public IP is dynamic (which is most likely the case unless you explicitly request and pay additional fees to ISPs to obtain a static IP)

Thread Thread
 
jesse1981 profile image
Jesse Bryant

Ah, I see what you mean now.

Must admit, a description of localhost tunneling didn't make sense to me since the localhost was more like the endpoint (but not of course when the connection being initiated from the client), but the explanation on the link you shared of Stream Multiplexing made it clearer - neat idea.

FWIW, I personally used to use the solution if NoIP, same result, instead that application was just reporting your current IP to the service.