Hi Adam,

It looks like you're running the main site through mod_wsgi, which means
that it does not support WebSockets; daphne won't help as you're running it
on a different port. Either you need to access the whole site via Daphne,
or change the code so that it appends a different port to the WebSocket
source URL (by default it's trying the same port as the page it's served on)

Andrew

On Thu, Nov 10, 2016 at 12:24 PM, Adam Teale <adamte...@gmail.com> wrote:

> Hi everyone,
>
> I am looking into Andrew Godwin's example project "channels-example" (
> https://github.com/andrewgodwin/channels-examples).
>
> The multichat demo runs fine using the development/localhost server and
> now I am attempting to put it into production mode so I can access across
> our network and test it out.
>
> I have my own django app that I have running on Mac OS X server using the
> Apache module mod_wsgi .
> I have used this same setup to get the multi chat demo running.
>
> I do understand that all http and web socket traffic can be handled by
> Daphne and that it isn't necessary to run the app via WSGI.
>
> I can access the multi chat app from a browser in another machine however
> when it comes to the part of the the app connecting via web sockets I get
> this error:
>
>
> *    WebSocket connection to 'wss://myexampleserver.local/chat/stream/'
> failed: Unexpected response code: 404*
>
> I have Daphne running like this:
>
> daphne multichat.asgi:channel_layer
>
>
> The terminal returns:
>
> Starting server at 127.0.0.1:8000, channel layer
> multichat.asgi:channel_layer
>
> Using busy-loop synchronous mode on channel layer
>
> The worker is running too via python manage.py runworker
>
> My feeling is that I do not have Daphne configured properly to receive the
> web socket connections from the appropriate port / IP address (it shouldn't
> be localhost right?).
>
> I hope that makes some sense and that someone might be able to shed some
> light on what I have misunderstood.
>
> Many thanks!
>
> Adam
>
>
>
> --
> 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 django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> 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/CAMse0ZhCxubi-EWgux9Xah%2BRd_
> JOSWHDW0HgqgvkZtWr%3DPkDAg%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAMse0ZhCxubi-EWgux9Xah%2BRd_JOSWHDW0HgqgvkZtWr%3DPkDAg%40mail.gmail.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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/CAFwN1urnpiXzMtJyNW-nPr_JwsE%2BBBpRcQwJeW2TCvhUGRUKbQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to