Can access AppEngine SDK sites via local ip-addres

2020-02-09 09:42发布

Can access AppEngine SDK sites via local ip-address when localhost works just fine and a MacOSX using the GoogleAppEngineLauncher.

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).

It seems like GoogleAppEngineLauncher defaults to localhost and blocks access to the ip-address directly. Is there a way to change that behaviour in GoogleAppEngineLauncher? Is this some kind of limitation built in by 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?

5条回答
狗以群分
2楼-- · 2020-02-09 10:17

As per the latest documentation -a wont work anymore.

This is possible by passing --host argument with dev_appserver.py command

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:

dev_appserver.py --host=0.0.0.0 <your_app>

查看更多
老娘就宠你
3楼-- · 2020-02-09 10:22

In Android Studio with Google App Engine plugin. Just add httpAddress = '0.0.0.0' to app cfg in build.grade file.

查看更多
姐就是有狂的资本
4楼-- · 2020-02-09 10:24

This is possible by passing the -a argument to dev_appserver.py, i.e. dev_appserver.py -a <your-ip> <your_app>. See also this article on using public IP addresses with the Google App Engine SDK.

查看更多
男人必须洒脱
5楼-- · 2020-02-09 10:25

For the eclipse (PyDev) users, Right-click on your project Run As > Run Configurations...

In the Arguments Tab, add the -a and -p arguments:

-a 0.0.0.0 -p 80 "${workspace_loc:project}"
查看更多
一纸荒年 Trace。
6楼-- · 2020-02-09 10:27

Per the docs, it's technically possible:

--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. Default is 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. 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!

查看更多
登录 后发表回答