doushenmao9036 2013-11-22 23:00
浏览 89
已采纳

无法从主机访问在Vagrant来宾中运行的App Engine Go SDK Web服务器(带有端口转发)

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?!!!

  • 写回答

1条回答 默认 最新

  • doukai2839 2013-11-22 23:08
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器