2018-07-09 23:22:26 +02:00
|
|
|
from channels.routing import ProtocolTypeRouter, URLRouter
|
|
|
|
from django.conf.urls import url
|
2016-05-29 08:29:14 +02:00
|
|
|
|
2018-07-09 23:22:26 +02:00
|
|
|
from openslides.utils.consumers import ProjectorConsumer, SiteConsumer
|
|
|
|
from openslides.utils.middleware import AuthMiddlewareStack
|
2016-09-17 22:26:23 +02:00
|
|
|
|
|
|
|
|
2018-07-09 23:22:26 +02:00
|
|
|
application = ProtocolTypeRouter({
|
|
|
|
# WebSocket chat handler
|
|
|
|
"websocket": AuthMiddlewareStack(
|
|
|
|
URLRouter([
|
|
|
|
url(r"^ws/site/$", SiteConsumer),
|
|
|
|
url(r"^ws/projector/(?P<projector_id>\d+)/$", ProjectorConsumer),
|
|
|
|
])
|
|
|
|
)
|
|
|
|
})
|