腾讯云主机python flask host 绑定问题
大家讲道理
大家讲道理 2017-04-18 10:22:05
0
1
658

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

请问这是为什么?

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

Antworte allen(1)
刘奇

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

Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage