Ngrok: How to open port 80

RPV picture RPV · Feb 3, 2016 · Viewed 33.8k times · Source

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.

Answer

Lupin picture Lupin · Nov 12, 2016

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