Adding django-socketio to existing Apache/mod_wsgi/Django site

自闭症网瘾萝莉.ら 提交于 2019-12-05 20:45:27

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!