OpenSlides/openslides/routing.py

16 lines
434 B
Python
Raw Normal View History

from channels.routing import ProtocolTypeRouter, URLRouter
from django.conf.urls import url
from openslides.utils.consumers import CloseConsumer, SiteConsumer
from openslides.utils.middleware import AuthMiddlewareStack
2019-01-06 16:22:33 +01:00
application = ProtocolTypeRouter(
{
# WebSocket chat handler
"websocket": AuthMiddlewareStack(
URLRouter([url(r"^ws/$", SiteConsumer), url(".*", CloseConsumer)])
)
2019-01-06 16:22:33 +01:00
}
)