用http-proxy-middleware做websocket代理,为什么连上之后立刻就中断了,报错failed: Invalid frame header
this.wsUrl = `ws://${location.host}/ctfo-platform-auth/websocket/${ticketId}`
this.ws = new WebSocket(this.wsUrl);
this.ws.onopen = () => {
console.log("连接已链接...");
};
this.ws.onclose = () => {
console.log("连接已关闭...");
};
this.ws.onmessage = (res) => {
console.log("收到服务器内容", res);
};
这个是websocket链接
'/ctfo-platform-auth': {
target: 'http://***.***.***:****',
changeOrigin: true,
xfwd:true,
ws:true,
secure:false,
}
这个是代理
请指教,谢谢