How to specify which domain using ngrok

Ronnie picture Ronnie · Feb 1, 2016 · Viewed 27.3k times · Source

I use mamp and I have virtual hosts all on port 8888. For example:

  • site1.dev:8888
  • site2.dev:8888

would point to localhost/site1/, localhost/site2/ etc.

Before using virtual hosts, I would just change my docroot to whatever project I was currently working on and would start ngrok like so

./ngrok http 8888 and it would launch and give me a random generated *.ngrok.io url.

My question is how do I specify the domain now since I am using virtual hosts?

I've tried ./ngrok http site1.dev:8888 and it starts but just serves up mamps webroot.

I am using a free account.

Answer

demanzonderjas picture demanzonderjas · Jul 4, 2017

If you prefer a free option, it is possible via:

$ ngrok http -host-header=site1.dev 80