Home  >  Q&A  >  body text

腾讯云主机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 days ago596

reply all(1)I'll reply

  • 怪我咯

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

    Host is the listening host, whichever host is bound will be monitored. Binding 0.0.0.0 means monitoring all.

    reply
    0
  • Cancelreply