This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vladislavko
Recipients eric.smith, vladislavko
Date 2021-07-07.14:38:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1625668726.58.0.590156098931.issue44577@roundup.psfhosted.org>
In-reply-to
Content
It will be not easy as I'll need to create some sandbox for you. The current code version is not available for sharing.


But ok. For example here is a routing.py file:

from django.conf.urls import url
from channels.routing import ProtocolTypeRouter, URLRouter
from channels.security.websocket import AllowedHostsOriginValidator
from channels.auth import AuthMiddlewareStack
from some_dir import MyConsumer

application = ProtocolTypeRouter({
    'websocket': AllowedHostsOriginValidator(
        AuthMiddlewareStack(
            URLRouter([
                url('api/socket/end-point-1', MyConsumer),
            ])
        )
    )
})

Let me know if you need more information
History
Date User Action Args
2021-07-07 14:38:46vladislavkosetrecipients: + vladislavko, eric.smith
2021-07-07 14:38:46vladislavkosetmessageid: <1625668726.58.0.590156098931.issue44577@roundup.psfhosted.org>
2021-07-07 14:38:46vladislavkolinkissue44577 messages
2021-07-07 14:38:46vladislavkocreate