index.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:Proxy-Factory 作者: ping99 项目源码 文件源码
def run_wsgi_app(address, app):
    try:
        from gunicorn.app.wsgiapp import WSGIApplication
        class GunicornApplication(WSGIApplication):
            def init(self, parser, opts, args):
                return {'bind': '%s:%d' % (address[0], int(address[1])),
                        'workers': 2,
                        'worker_class': 'gevent'}
            def load(self):
                return application
        GunicornApplication().run()
    except ImportError:
        from gevent.wsgi import WSGIServer
        WSGIServer(address, app).serve_forever()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号