from django.urls import path
from channels.routing import ProtocolTypeRouter, URLRouter
from channels.auth import AuthMiddlewareStack
from myapp.consumer import Chating, WebRTCConsumer

websocket_urlpatterns = [
    # path('ws/chat/', Chating.as_asgi()),
    # path(r'ws/live/(?P<match_id>\d+)/$', Chating.as_asgi()),
    path('ws/live/<int:match_id>/', Chating.as_asgi()),
    path('ws/webrtc/<int:room_id>/', WebRTCConsumer.as_asgi()),



]

application = ProtocolTypeRouter({
    'websocket': AuthMiddlewareStack(
        URLRouter(
            websocket_urlpatterns
        )
    ),
})