Skip to content

armgit / mso

Public Imported from GitHub
0

Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.

1.1 KB
Raw Blame
export const SERVER_SOURCE = `// Fake Orca upstream listener child. Explicitly NOT real Orca acceptance.
const http = require("node:http");
const server = http.createServer((req, res) => {
  if (process.send) process.send({ type: "hit", hit: { url: req.url || "", host: req.headers.host || "" } });
  if ((req.url || "").split("?")[0] === "/web-index.html") {
    res.writeHead(200, { "content-type": "text/html; charset=utf-8" });
    res.end("<!doctype html><title>Orca fixture</title>orca-fixture-upstream\\n");
    return;
  }
  res.writeHead(404, { "content-type": "text/plain" });
  res.end("upstream: no such path\\n");
});
server.listen(0, "127.0.0.1", () => {
  const a = server.address();
  if (process.send) process.send({ type: "listening", port: typeof a === "object" && a ? a.port : 0 });
});
function shutdown() {
  server.closeAllConnections?.();
  server.close(() => process.exit(0));
  setTimeout(() => process.exit(0), 1000).unref();
}
process.on("message", (m) => { if (m === "close" || m?.type === "close") shutdown(); });
process.on("SIGTERM", shutdown);
process.on("SIGINT", shutdown);
setInterval(() => {}, 1 << 30);
`;