Heim  >  Fragen und Antworten  >  Hauptteil

腾讯云主机python flask 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访问

请问这是为什么?

大家讲道理大家讲道理2740 Tage vor594

Antworte allen(1)Ich werde antworten

  • 怪我咯

    怪我咯2017-04-18 10:24:05

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

    Antwort
    0
  • StornierenAntwort