Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

App Engine Go SDK web server running in Vagrant guest (with port forwarding) not reachable from host

I'm running GAE dev server within a Vagrant guest precise64 box with the following network setup (in my Vagrantfile):

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.network :forwarded_port, guest: 8080, host: 9090
end

Which does its thing:

[default] Forwarding ports...
[default] -- 8080 => 9090 (adapter 1)

I start my App Engine server with:

goapp serve

or

dev_appserver.py myappfolder

This starts app engine dev server as expected:

INFO 2013-11-22 dispatcher.py] Starting module running at: http://localhost:8080

In all cases, I'm able to ssh in to the Vagrant guest and curl localhost:8080 successfully.

Unfortunately, from the host I'm unable to get a response from localhost:9090 when running GAE dev web server. Additionally, I've made sure that I don't have anything interfering with the port 9090 on the host machine. Also, I'm almost positive this isn't related to Vagrant as I spun up a quick node.js web server on 8080 and was able to reach it from the host. What am I missing?!!!

like image 842
Matt Self Avatar asked Nov 22 '13 23:11

Matt Self


1 Answers

You must run the Google App Engine Go dev web server on 0.0.0.0 when leveraging Vagrant port forwarding. Like so:

goapp serve -host=0.0.0.0

See the answers here for more info on ensuring the guest web server is not bound to 127.0.0.1 which is loopback. Web servers that bind to 127.0.0.1 (like App Engine Go dev web server does) by default should be overridden to use 0.0.0.0.

like image 179
Matt Self Avatar answered Oct 07 '22 03:10

Matt Self