Spring 整合WebSocket, Error during WebSocket handshake: Unexpected response code: 302 还有200的错误

springboot 集成websocket 及其简单,,,但是管理端使用的是Spring,原生配置,发生这个错误,,,302 被重定向了...我起的是本地locallhost,把ip换成 localhost就可以了..真是匪夷所思.

本地浏览器使用的是localhost,这边配置也需要localhost,127.0.0.1都不行

然后报错200 https://blog.csdn.net/slt6366078/article/details/80360941
因为soket在浏览器不支持wobsoket请求是会自动切换为http请求轮训方式,除去withSockJS()去除!

原文地址:https://www.cnblogs.com/jinjian91/p/10537099.html