Proxy authenticated file explorer downloads and previews

This commit is contained in:
2026-11-07 01:51:12 +00:00
parent 54ffb5d022
commit b33970182c
3 changed files with 62 additions and 3 deletions
+3 -3
View File
@@ -4,7 +4,7 @@
// [--root DIR] [--updates DIR]
//
// Serves the app (--root, default ../app/build/web) and proxies /connect,
// /artifacts/ and /chat-uploads to the Pipelines server, so the page, the
// /artifacts/, /files and /chat-uploads to the Pipelines server, so the page, the
// WebSocket and artifact files share one origin. --updates serves the Android
// app's update feed at /updates/.
//
@@ -449,7 +449,7 @@ const server = createServer(async (req, res) => {
return;
}
}
if (pathname.startsWith("/artifacts/")) {
if (pathname.startsWith("/artifacts/") || pathname === "/files") {
proxyArtifact(req, res);
return;
}
@@ -566,7 +566,7 @@ const host = flag(process.argv, "--host", "127.0.0.1");
server.listen(port, host, () => {
const shown = host === "0.0.0.0" ? "127.0.0.1" : host;
console.log(`web spike: http://${shown}:${port}/ (bound ${host}:${port})`);
console.log(`proxying /connect (ws) and /artifacts/ (http) -> ${targetHost}:${targetPort}`);
console.log(`proxying /connect (ws), /artifacts/ and /files (http) -> ${targetHost}:${targetPort}`);
console.log(auth ? "auth: sign-in required" : "auth: DISABLED (tests)");
console.log(`serving ${ROOT}${UPDATES ? `; app updates from ${UPDATES}` : ""}`);
});