Nodejs on Vagrant - cannot load page from outside

Trying to download http: // localhost: 3000 in a browser does not work from my Windows machine, but when I do it

curl -v http://localhost:3000

on my roaming VM - the page loads fine.

I was thinking about a port forwarding problem, so I installed

config.vm.network :forwarded_port, guest: 3000, host: 3000

in the vagrant configuration file, but that doesn't help.

I tried to capture calls on port 3000 on my vm, like this

sudo tcpdump -i eth0 'port 3000'

This indicates that the roaming virtual machine may hear my calls to her, but nodemon is not aware of this.

I'm stuck here, any advice appreciated.

Thank!

+1
source share
1 answer

Thank you m1keil !

I did sudo iptables -I INPUT -p tcp --dport 3000 -j ACCEPTand solved the problem

+5
source

Source: https://habr.com/ru/post/1598989/


All Articles