腾讯云VPS主机python flask host 绑定出问题,vpsflask,app.run(host


app.run(host='公网IP',port=8080)这样不能使用公网ip访问
app.run(host='内网IP',port=8080)这样可以使用公网ip访问
app.run(host='0.0.0.0',port=8080)这样可以使用公网ip访问

请问这是为什么?

host是监听的主机, host绑定哪个就监听哪个. 绑定0.0.0.0表示监听所有.

编橙之家文章,

评论关闭