文章详情页
腾讯云主机python flask host 绑定问题
浏览:101日期:2022-09-12 16:27:51
问题描述
app.run(host=’公网IP’,port=8080)这样不能使用公网ip访问app.run(host=’内网IP’,port=8080)这样可以使用公网ip访问app.run(host=’0.0.0.0’,port=8080)这样可以使用公网ip访问
请问这是为什么?
问题解答
回答1:host是监听的主机, host绑定哪个就监听哪个. 绑定0.0.0.0表示监听所有.
相关文章:
排行榜
