錯誤分析
websocket: the client is not using the websocket protocol: 'upgrade' token not found in 'Connection' head
當反向代理或負載均衡未正確傳遞WebSocket
請求時,就會出現此問題。
解決方案
Nginx加上以下解析
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade
Apache加上以下解析
<Location /ws>
ProxyPass ws://localhost:8000
ProxyPassReverse ws://localhost:8000/
</Location>