For future reference, this discussion is also happening here:
https://github.com/django/channels/issues/445

On Mon, Dec 5, 2016 at 2:04 AM, yass45 <[email protected]> wrote:

> Hello,
>
>
> I try to use Django Channels on my website developed with Django 1.10 and
> Python 3.5. This website is hosted on Webfaction.
>
> My problem is about the socket, the connection doesn't works, I have this
> error when I go to the home page of the website :
>
> WebSocket connection to 'ws://mywebsite.com/' failed: Error during
> WebSocket handshake: Unexpected response code: 200
> Disconnected from chat socket
>
>
> I created the websocket in a Javascript file :
>
> var ws_scheme = window.location.protocol == "https:" ? "wss" : "ws";
> var ws_path = ws_scheme + '://' + window.location.host + 
> window.location.pathname;                                    
> var socket = new WebSocket(ws_path);
>
>
> I have already configure Redis server and it works :
>
> CHANNEL_LAYERS = {
>     "default": {
>         "BACKEND": "asgi_redis.RedisChannelLayer",
>         "CONFIG": {
>             "hosts": [("localhost", 111111)],
>         },
>       "ROUTING": "projup.routing.channel_routing",
>     },
> }
>
> *111111 is the port number of an application.*
>
>
> My ALLOWED_HOST configuration is :
>
> ALLOWED_HOSTS = [
>         '.mywebsite.com',
>         '.mywebsite.net',
> ]
>
> I don't have error logs.
>
>
> How can I resolve this problem (websocket connection impossible) ?
> Do you need a new app/port for the websocket ?
> Should I use the port of my website ? How ?
> Do you need to run a command that would start listening on a port ?
>
>
> Thank you ! :)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/12f8dea7-e32e-4c31-9269-0553f221ae10%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/12f8dea7-e32e-4c31-9269-0553f221ae10%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFwN1uqN%3DoqVM1RJPGk_dh4LLYXiPbZf9G9F3-X4bwrvDgLvHw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to