How to have one Flask app listen on two different ports?

前端 未结 2 1525
清酒与你
清酒与你 2020-12-18 07:01

Is it possible to have a single flask app with routes on two different ports? My Flask app needs to listen for webhooks and due to some security biz it can\'t receive foreig

2条回答
  •  北荒
    北荒 (楼主)
    2020-12-18 07:11

    A server by default only listens to a single port. Wouldn't it make more sense, since the additional port requires additional functionality, to implement a front-end server on the second port that proxies the POST request locally? There are many well-documented ways to do this such as this one

提交回复
热议问题