fix: api watch data

This commit is contained in:
jialin
2024-06-29 23:24:12 +08:00
parent afb2a13b80
commit 9f4f28edaf
8 changed files with 48 additions and 12 deletions
+12
View File
@@ -11,6 +11,18 @@ export default function createProxyTable(target?: string) {
secure: false,
ws: true,
pathRewrite: (pth: string) => pth.replace(`/^/${api}/`, `/${api}`),
// onProxyRes: (proxyRes: any, req: any, res: any) => {
// if (req.headers.accept === 'text/event-stream') {
// res.writeHead(res.statusCode, {
// 'Content-Type': 'text/event-stream',
// 'Cache-Control': 'no-transform',
// Connection: 'keep-alive',
// 'X-Accel-Buffering': 'no',
// 'Access-Control-Allow-Origin': '*'
// });
// proxyRes.pipe(res);
// }
// },
headers: {
origin: newTarget,
Connection: 'keep-alive'