Access ngrok web interface in Vagrant box

I have a box of strollers, which I use for local development. I am working on a webhook that is called externally; so I'm thinking of using ngrok.com for proxy requests in my Vagrant environment. I'm new to this ngrok thing.

I am trying to figure out how to access the ngrok web interface, which is usually located at http://127.0.0.1:4040 . Of course, this does not work from my browser, because it is outside the Vagrant field, so its local host is not a dirty local host.

I (I think) have a Vagrant IP address. I found it in the config.yaml file (yes, with a), under vm: network: private_network: 192.168.nnn.nnn

Thank you for your help.

+7
vagrant localhost ngrok
source share
4 answers

When trying to access a site in a virtual machine, put ngrok in the host machine and invoke it with:

ngrok http -host-header=rewrite mydomain.com:80 

You need to access your site (in the host browser) using

 http://123456.ngrok.io 

But he will rewrite it at mydomain.com .

And you can access the ngrok control panel (in the host browser) using

 http://127.0.0.1:4040 

Docs at https://ngrok.com/docs#host-header . Good luck

+29
source share

Your problem is this: https://github.com/inconshreveable/ngrok/issues/153

You need to create a configuration file with the following contents:

 web_addr: 0.0.0.0:4040 

And then run ngrok as follows:

 ngrok http 3000 -config=/path/to/ngrok.conf 

Now you can access the web interface from your browser using the following addresses: http: // vagrantip: 4040 or <a2>

For example, http://192.168.33.34:4040 or http://site.dev:4040 if your / etc / hosts is configured this way

Further information on the ngrok configuration file is here: https://ngrok.com/docs#config

+9
source share

Change the configuration of nano ~/.ngrok2/ngrok.yml by adding the following:

web_addr: 0.0.0.0:4000

This will allow access to your ngrok control panel on your host computer.

+2
source share

add the following line to the Vagrantfile

 config.vm.network "forwarded_port", guest: 4040, host: 8080 

then you can access http: // localhost: 8080 or http://127.0.0.1:8080 from the host system. You can ask for help Wandering documentation .

or

go to the guest machine using the command:

 vagrant ssh vmname 

and check the ip of the guest machine using ifconfig . the tramp uses the default network and assigns one ip to the guest machine, so using this ip you can access the web interface from your host http: // vagrantip: 4040

or

You can create or assign a public or private network IP address. contact stray networks

+1
source share

All Articles