Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ngrok: How to open port 80

I have just installed ngrok on my local machine, ran

ngrok http 80

as usual.

However when I try to access port 80

localhost:80 

I get this error message

The connection to http://*******.ngrok.io was successfully tunneled to your ngrok client, but the client failed to establish a connection to the local address localhost:80.

I am really unsure why this is occurring, and browsed around stackoverflow, but did not quite understand the answers I read. Hoping to diagnose afresh and build understanding from here.

OS is Mac OS.

like image 702
RPV Avatar asked Feb 03 '16 12:02

RPV


People also ask

How do I change my Ngrok port?

Can I change the port on the ngrok domain? ngrok does not allow users to change the public ports on any reserved Domain or TCP Address. HTTPS and TLS tunnels will use port 443, and TCP tunnels will use the port assigned to you when the tunnel is created.

How do I run Ngrok on port 3000?

Tunnel ngrok to localhostOpen a terminal window and navigate to your myapp directory. Run npm start to start the app. By default, Express generator apps start the server on localhost:3000. If you want to change the port, it's defined in the app's bin/www file on line 15, but we'll leave it on port 3000 for now.

What ports does Ngrok use?

ngrok's TCP tunnels are perfect for SSH traffic. Simply start a TCP tunnel to port 22 and you should be all set.


1 Answers

ngrok enables us to connect with http://xxx.ngrok.io with local server. Yup, all you do is just running server such as Apache, nginx or something. It is allowed build-in local server in your language.

sudo apachectl start
ngrok http 80

If you love PHP, you can follow below.

php -S localhost:8080
ngrok http 8080

Good Luck :D

like image 98
Lupin Avatar answered Sep 17 '22 12:09

Lupin