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>

相关文章:

  • 2022-12-23
  • 2021-07-31
  • 2021-08-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
猜你喜欢
  • 2021-11-07
  • 2021-09-26
  • 2022-12-23
  • 2022-12-23
  • 2021-09-20
  • 2021-12-15
  • 2022-12-23
相关资源
相似解决方案