I'm running my application on a local Vagrant VM on my computer and I was wondering if I created a node server that ran on localhost (also on my computer) would I be able to access the node server from my Vagrant application ?
With default vagrant settings, you can reach your host computer via the IP 10.0.2.2
. This is at least true for the VirtualBox provider. I haven't tested others so far.
If you have configured your node server on the host machine in way that it listens to all IP addresses assigned to your host computer you should be able to access
http://10.0.2.2
from within the vagrant virtual machine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With