flask默认端口是5000,我正在使用计算引擎,并从本地机器浏览器测试我的服务,为此,我向app.run函数添加了参数host = '0.0.0.0'。我执行这个脚本,我的简单hello world服务就会运行,我已经读到,我可以通过向app.run命令添加参数app.run(host = '0.0.0.0' , port=5050 , debug = True)来指定一个特定的端口,所以现在它看起来像这样: port它执行得很好
* Running on http://0.0.0.0:5050/
* Restarting with reloader 但是当我从浏览器调用它时,我得到了错误Oops! Google Chrome could not connect to <compute engine instance external ip>:5050
我需要“打开”端口5050吗?如果需要,在哪里“打开”,如何“打开”
发布于 2013-11-19 09:41:26
看看https://developers.google.com/compute/docs/networking吧。
它应该详细解释如何将google计算引擎连接到外部世界,以及如何配置防火墙以允许连接。
https://stackoverflow.com/questions/20060524
复制相似问题