2017-10-09 41 views
1

我想配置django频道在我的Ubuntu服务器(数字海洋)上运行。Django频道服务器配置:Ubuntu。 404上的握手

我有运行在port 6379上的redis服务器。 达芙妮在端点unix:/home/mysite/sockets/mysite.sockHTTP/2 support enabled(不知道这是必需的在这个阶段) 我也有一个./manage.py runworker倾听。 我达芙妮运行命令是

daphne -u /home/mysite/sockets/mysite.sock project.asgi:channel_layer 

我的HTTP请求来实现(在达芙妮日志),因为他们在我的本地环境确实如

#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 

然而,当我要求的WebSocket网址通过JS一切散花......

#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可能会被解雇吗?或者关于调试的任何提示。

谢谢。

回答

相关问题