有没有办法在本地网络中访问 GAE 开发应用服务器? [英] Is there any way to access GAE dev app server in the local network?

查看:26
本文介绍了有没有办法在本地网络中访问 GAE 开发应用服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我通过 http://localhost:8080 从同一台 Win 7 PC 访问我的网站,服务器位于运行,然后它运行良好.

If I access my web site via http://localhost:8080 from the same Win 7 PC, where server is running, then it works well.

如果我尝试从另一台 PC 访问它(使用我内部 PC 的 ip http://192.168.1.98:8080),然后它不起作用.此外,即使在同一台机器上也无法使用此 ip 访问它.我做错了什么?

If I try to access that from another PC (with usage of my internal PC's ip http://192.168.1.98:8080), then it doesn't work. Moreover, it is not accessible with this ip even on the same machine. What am I doing wrong?

(我尝试在我的 Win 7 PC 上禁用防火墙 - 没有帮助)

(I've tried to disable firewall on my Win 7 PC - it didn't help)

推荐答案

首先检查你的服务器是在环回还是在所有接口上监听 - 在 netstat -an 中的命令行类型中找到带有端口的行8080 和状态 LISTENING,类似这样:

First check whether your server listens on loopback or on all interfaces - in command line type in netstat -an find a line with port 8080 and state LISTENING, something like this:

  TCP    0.0.0.0:8080           0.0.0.0:0              LISTENING

如果 IP 为 0.0.0.0,则表示它侦听所有 IP 地址,问题在于其他东西阻止了它.

If IP is 0.0.0.0 it means it listens on all IP addresses and the problem is with something else blocking it.

如果 IP 是 127.0.0.1 那么你需要绑定到 0.0.0.0 地址.现在是有趣的人 - 根据 文档,您应该添加--address=0.0.0.0--host=0.0.0.0 到运行配置中的参数(取决于 GAE 版本 - 谢谢@momijigari).但在我的情况下,我也有 GWT 和参数去 GWT,它不接受这个参数.但另一方面,侦听所有接口,我个人试图将其更改为 localhost.虽然 GWT 有 -bindAddress 参数,但它只设置代码服务器的地址(默认为 9997 端口),而不是 HTTP.

If IP is 127.0.0.1 then you need to bind to 0.0.0.0 address. And now the fun beings - according to documentation, you should add --address=0.0.0.0 or --host=0.0.0.0 to arguments in run configuration (depends on GAE version - thank you @momijigari). But in my case I have also GWT and parameters go to GWT and it does not accept this argument. But on the other hand listens on all interfaces, which I personally was trying to change to localhost. The GWT has -bindAddress parameter though, but it sets only address for code server (one with 9997 port by default), not HTTP.

这篇关于有没有办法在本地网络中访问 GAE 开发应用服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆