简体   繁体   English

当localhost正常工作和MacOSX时,可以通过本地IP地址访问AppEngine SDK站点

[英]Can access AppEngine SDK sites via local ip-address when localhost works just fine and a MacOSX

Can access AppEngine SDK sites via local ip-address when localhost works just fine and a MacOSX using the GoogleAppEngineLauncher. 当localhost正常工作时可以通过本地ip-address访问AppEngine SDK站点,使用GoogleAppEngineLauncher可以访问MacOSX。

I'm trying to setup facebook development site (using a dyndns.org hostname pointing at my firewall which redirects the call to my mac book). 我正在尝试设置Facebook开发站点(使用指向我的防火墙的dyndns.org主机名,将调用重定向到我的mac书)。

It seems like GoogleAppEngineLauncher defaults to localhost and blocks access to the ip-address directly. 似乎GoogleAppEngineLauncher默认为localhost并直接阻止对ip-address的访问。 Is there a way to change that behaviour in GoogleAppEngineLauncher? 有没有办法在GoogleAppEngineLauncher中更改该行为? Is this some kind of limitation built in by Google? 这是Google内置的某种限制吗?

It doesn't seem to be an issue of configuration, because there isn't any settings for this. 它似乎不是配置问题,因为没有任何设置。 So I'm guessing patching the source will be required? 所以我猜测修补源将是必需的?

As per the latest documentation -a wont work anymore. 根据最新文档 -a不再工作了。

This is possible by passing --host argument with dev_appserver.py command 这可以通过使用dev_appserver.py命令传递--host参数来实现

dev_appserver --host=<your_ip_address> <your_app>

--host= The host address to use for the server. You may need to set this to be able to access the development server from another computer on your network. An address of 0.0.0.0 allows both localhost access and hostname access. Default is localhost.

if you want to access development server using localhost & ip address, use this command: 如果要使用localhost和ip地址访问开发服务器,请使用以下命令:

dev_appserver.py --host=0.0.0.0 <your_app>

For the eclipse (PyDev) users, Right-click on your project Run As > Run Configurations... 对于eclipse(PyDev)用户,右键单击项目Run As > Run Configurations...

In the Arguments Tab , add the -a and -p arguments: Arguments选项卡中 ,添加-a和-p参数:

-a 0.0.0.0 -p 80 "${workspace_loc:project}"

This is possible by passing the -a argument to dev_appserver.py , ie dev_appserver.py -a <your-ip> <your_app> . 这可以通过将-a参数传递给dev_appserver.py ,即dev_appserver.py -a <your-ip> <your_app> See also this article on using public IP addresses with the Google App Engine SDK . 另请参阅有关在Google App Engine SDK中使用公共IP地址的文章

Per the docs, it's technically possible: 根据文档,它在技术上是可行的:

--address=... --address = ...

The host address to use for the server. 用于服务器的主机地址。 You may need to set this to be able to access the development server from another computer on your network. 您可能需要将其设置为能够从网络上的另一台计算机访问开发服务器。 An address of 0.0.0.0 allows both localhost access and hostname access. 地址0.0.0.0允许本地主机访问和主机名访问。 Default is localhost. 默认为localhost。

However, it may be risky: dev_appserver is strictly focused on development , not hardened in terms of security against the attacks you might be subject to if you serve on the open net. 但是,它可能存在风险: dev_appserver严格关注开发 ,而不是在安全性方面加强对抗您在开放网络上服务时可能受到的攻击。 To deploy App Engine apps on your own server(s) (or Amazon, etc), you might be better off with alternative, open-source third-party solutions like appscale or typhoonae ! 要在您自己的服务器(或亚马逊等)上部署App Engine应用程序,您可能会更好地使用替代的开源第三方解决方案,例如appscaletyphoonae

In Android Studio with Google App Engine plugin. 在带有Google App Engine插件的Android Studio中。 Just add httpAddress = '0.0.0.0' to app cfg in build.grade file. 只需将httpAddress = '0.0.0.0'添加到build.grade文件中的app cfg即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM