关于websocket接口WebSocket is closed before the connection is established. 奇奇怪怪的问题 2022-07-25 7,225 阅读1分钟 问题:webpack接口报错WebSocket is closed before the connection is established. 解决 1.排查后端接口-通过复制websocket接口,在线上测试后端接口是否可以正常返回--测试结果,后端可以正常返回 2.开始排查前端代码---一调用websocket方法,直接跳到关闭的方法中调用 3.正确的写法如下 为自己的愚蠢浪费一下午的时间