fix: bug
This commit is contained in:
@@ -19,8 +19,15 @@ export default defineConfig({
|
||||
'/ws': {
|
||||
target: 'ws://localhost:3001',
|
||||
ws: true,
|
||||
changeOrigin: true,
|
||||
configure: (proxy) => {
|
||||
proxy.on('error', () => {}) // 后端未启动时静默失败
|
||||
// 抑制关标签/刷新时代理底层 socket 的 ECONNRESET,避免刷屏
|
||||
proxy.on('proxyReqWs', (proxyReq, req, socket, head) => {
|
||||
socket?.on?.('error', () => {})
|
||||
const out = (proxyReq as { socket?: { on?: (e: string, fn: () => void) => void } })?.socket
|
||||
out?.on?.('error', () => {})
|
||||
})
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user