nodejs on Vagrant - can't load the page from o

2019-04-14 04:00发布

问题:

Trying to load http://localhost:3000 in browser doesn't work from my windows machine, but when I do this

curl -v http://localhost:3000

on my vagrant VM - page loads fine.

I was thinking about port forwarding issue, so I set

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

in vagrant config file, but it doesn't help.

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

sudo tcpdump -i eth0 'port 3000'

This indicates that vagrant VM can hear my calls to it, but nodemon doesn't know about it.

I'm stuck here, any advice appreciated.

Thanks!

回答1:

thank you m1keil!

I did sudo iptables -I INPUT -p tcp --dport 3000 -j ACCEPT and it solved the problem