Hi Adam,

That document is the totality of what I have personally written, so I can't
direct you to others. If we can work out what you're missing we can add it.

Basically, all you need to do is:

* Run Daphne to listen on a port (8000 by default, but you can pick)
* Make your frontend webserver (sounds like Apache for you) proxy all
requests to this port
* Optionally: Make apache either proxy or use mod_wsgi based on path prefix

Andrew

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

> Hi Andrew,
>
> Thank you very much for you help.
>
> Can you direct me to where I might be able to find some info about
> configuring Daphne for production?
>
> I've gone through what you have available on the Read the docs (
> https://channels.readthedocs.io/en/stable/deploying.html) however I think
> I need some more basic information on setting up the server itself so that
> Daphne is doing all the work - or perhaps I am missing something completely
> obvious here.
>
> Thanks again Andrew!
>
> Adam
>
>
> On Thursday, 10 November 2016 17:33:32 UTC-3, Andrew Godwin wrote:
>>
>> 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 <adam...@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...@googlegroups.com.
>>> To post to this group, send email to django...@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/ms
>>> gid/django-users/CAMse0ZhCxubi-EWgux9Xah%2BRd_JOSWHDW0Hgqgvk
>>> ZtWr%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/a56a2f47-f081-4658-8bf7-88b184330b0b%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/a56a2f47-f081-4658-8bf7-88b184330b0b%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 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/CAFwN1uqSKnWLoBMOpWV4aXpE9si89z75SfPG-Gx5E3egdJGoxg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to