Daphne is Andrew's ASGI interface server that supports WebSockets & long-poll HTTP requests. WSGI does not.
With Daphne running on localhost on a port that MacOS isn't occupying (i went with 8001) the idea was to get Apache to reverse proxy certain requests to Daphne.
Daphne can be run on a specified port (8001 in tis example) like so (-v2 for more feedback):
daphne -p 8001 yourapp -v2
I wanted Daphne to handle only the web socket connections (as I use currently depend on some apache modules for serving media such as mod_xsendfile). In my case the websocket connection was via /chat/stream/ based on Andrew's demo project.
From what I had read in MacOS Server's implementation of Apache the idea is to declare these proxypass commands inside the virtual host files of your "sites" in:
/Library/Server/Web/Config/apache2/sites/
In config files such as:
0000_127.0.0.1_34543_.conf
I did also read that any customisation for web apps running on MacOS Server should be made to the plist file for the required web app in:
/Library/Server/Web/Config/apache2/webapps/
In a plist file such as:
com.apple.webapp.wsgi.plist
Anyway...
I edited the 0000_127.0.0.1_34543_.conf file adding:
Eager to test out my first web socket chat connection I refreshed the page only to see an error printed in the apache log: