简体   繁体   English

Google App Engine,gradle,开放端口

[英]Google App Engine, gradle, open port

I'm developing an android app with Google app engine endpoint using Android Studio. 我正在使用Android Studio使用Google App Engine端点开发一个Android应用程序。

Is it possible to make the local app engine server open the port it is running on? 是否可以使本地App Engine服务器打开其正在运行的端口? I'm trying to debug an android application with a phone that is in the same LAN as my app engine server but I can't do that because the ports doesn't open. 我正在尝试使用与我的应用引擎服务器位于同一局域网中的电话调试android应用程序,但由于端口未打开,我无法执行此操作。 Meaning, while I'm able to reach the server program at localhost:8080 from the server computer, I'm not able to reach it from my phone at {server_ip}:8080 . 意思是,虽然我可以从服务器计算机访问位于localhost:8080的服务器程序,但无法从电话位于{server_ip}:8080访问该服务器程序。

Now I'm sure I am not having problems with port-forwarding in my router, since when I take the generated war-file and deploy it to a tomcat server, I'm able to reach the server from my phone. 现在,我确定路由器中的端口转发没有问题,因为当我将生成的war-file部署到tomcat服务器时,便可以从手机访问该服务器。 But then I will not be able to do a step-by-step debugging in Android Studio. 但是那样我将无法在Android Studio中进行逐步调试。

Thanks NNJ, 感谢NNJ,

After reading that post ( https://stackoverflow.com/a/21776775 ), I understood that I should include httpAddress = '0.0.0.0' in my build.gradle for the server module and now I'm able to reach the endpoints from outside the server. 阅读了该帖子( https://stackoverflow.com/a/21776775 )之后,我了解到我应该在build.gradle中为服务器模块添加httpAddress = '0.0.0.0' ,现在可以访问端点了从服务器外部。

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

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