websocket request header miss upgrade

Deadly 提交于 2019-12-11 08:46:58

问题


I use tornado develop a websocket server, and I use nginx delegate the python server, the nginx config a server_name, and my server in Chian, and I connect the websocket server from China, it work OK, and I connect it from Australia use Wifi, it also work OK, but when I connect from Australia use 3G, it doesn't work, the request header miss upgrade node, why this happen?


回答1:


Because there is a proxy in the middle of that 3G connection.

The "Upgrade" header is marked as a connection header ("Connection:Upgrade"), that means that header must be removed in the next hop. So proxies remove that header.

You should use a secure WebSocket (wss://) to avoid proxies messing with your headers.

How HTML5 Web Sockets Interact With Proxy Servers

Cheers.



来源:https://stackoverflow.com/questions/23520653/websocket-request-header-miss-upgrade

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!