Nginx和uWSGI的服务器发送事件 [英] Server-Sent Events with Nginx and uWSGI
本文介绍了Nginx和uWSGI的服务器发送事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以使用uWSGI和Nginx背后的python/Flask应用程序中的服务器发送的事件 ?
Is it possible to use server-sent events from a python/Flask application that is behind uWSGI and Nginx?
我已经找到了在python/Flask中实现SSE的软件包,但它们似乎都使用gevent和greenlets来实现.
I've found packages that implement SSE in python/Flask, but they seem to all do so using gevent and greenlets.
https://github.com/DazWorrall/flask-sse
谢谢!
推荐答案
uWSGI的最新版本(从1.9开始)具有对websockets/SSE的内置支持.本文提供了出色的指南:
Recent versions of uWSGI (from 1.9) have built-in support for websockets / SSE. This article provides an excellent guide:
这篇关于Nginx和uWSGI的服务器发送事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文