且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将django-socketio添加到现有的Apache / mod_wsgi / Django站点

更新时间:2023-02-17 07:52:59

You should be able to run the regular site behind a public facing server like Apache, with the runserver_socketio part just serving websockets on a separate port. As described in the question you linked to, you'll need to work out if it's possible to proxy websockets through your web server if that's a requirement for you, but as also mentioned the gevent server used by runserver_socketio is more than capable.

When running separate instances like this, the "out of band" functions won't work, as they depend on shared state:

django_socketio.broadcast(message)
django_socketio.broadcast_channel(message, channel)
django_socketio.send(session_id, message)

You'll also need to add the SOCKETIO_PORT to the regular Django project's settings so that it knows which port to use.

上一篇 : :如何对 ASP.NET Core 控制器或模型对象进行单元测试?下一篇 : 我什么时候应该使用 javascript 框架库?

相关阅读

技术问答最新文章