Django频道服务器配置:Ubuntu。404关于握手

Django频道服务器配置:Ubuntu。404关于握手,ubuntu,websocket,django-channels,redis-server,daphne,Ubuntu,Websocket,Django Channels,Redis Server,Daphne,我正在尝试将django频道配置为在我的ubuntu服务器(digital ocean)上运行 我的redis服务器在端口6379上运行。 Daphne正在端点unix:/home/mysite/sockets/mysite.sock上监听,启用了HTTP/2支持(不确定此阶段是否需要) 我还有一个/manage.py runworker监听。 我的daphne run命令是 daphne -u /home/mysite/sockets/mysite.sock project.asgi:chan

我正在尝试将django频道配置为在我的ubuntu服务器(digital ocean)上运行

我的redis服务器在端口6379上运行。 Daphne正在端点
unix:/home/mysite/sockets/mysite.sock
上监听,启用了
HTTP/2支持(不确定此阶段是否需要)
我还有一个
/manage.py runworker
监听。 我的daphne run命令是

daphne -u /home/mysite/sockets/mysite.sock project.asgi:channel_layer
我的http请求(在daphne日志中)与我在本地环境中的请求相同

#local
127.0.0.1:62241 - - [09/Oct/2017:21:03:41] "GET /playground/channel-simple" 200 1826

#server (side note. not sure why port + host are eliminated here.?)
None - - [09/Oct/2017:21:53:51] "GET /playground/channel-simple" 200 1622
然而,当我通过js请求websocket url时,一切都会分崩离析

#local
127.0.0.1:62268 - - [09/Oct/2017:21:03:43] "WSCONNECTING /chat/private-room/" - -
127.0.0.1:62268 - - [09/Oct/2017:21:03:43] "WSCONNECT /chat/private-room/" - -

#server
None - - [09/Oct/2017:21:54:04] "GET /chat/private-room/" 404 86
它看起来像是将请求视为http请求而不是websocket连接?这也是js控制台日志

#server - js response to connection
WebSocket connection to 'ws://[MY-IP]/chat/private-room/' failed: Error during WebSocket handshake: Unexpected response code: 404
有人能告诉我这辆404可能在哪里被解雇吗?或任何关于调试的提示


谢谢。

我已经解决了这里的问题,现在可以在服务器上正常工作了。我还没有完成nginx配置。努布:)

下面的文章很有用