fix(cli): preserve public host in local API proxy

This commit is contained in:
jxxghp
2026-11-17 17:19:53 +08:00
parent ff5e785888
commit 2c90a22fdd
2 changed files with 21 additions and 0 deletions

View File

@@ -300,6 +300,8 @@ LOCAL_FRONTEND_SERVICE_SCRIPT = textwrap.dedent(
app.use(
'/api',
proxy(`${backendHost}:${backendPort}`, {
// 保留设备访问的主机名,避免播放清单生成后端回环地址。
preserveHostHdr: true,
proxyReqPathResolver: req => `/api${req.url}`
})
)