#!/usr/bin/env node // Throwaway HTTPS origin server for scripts/smoke-test.sh — cache.js only // proxies https:// origins, so the smoke test needs *something* self-signed // to fetch-through, not a real oxmc.me dependency. Not used outside the // smoke test. const { createServer } = require("node:https"); const selfsigned = require("selfsigned"); const port = Number(process.argv[2] || 9443); const body = Buffer.from("hello from dummy origin\n"); const pems = selfsigned.generate([{ name: "commonName", value: "localhost" }], { days: 1 }); createServer({ cert: pems.cert, key: pems.private }, (req, res) => { res.writeHead(200, { "content-type": "text/plain", "content-length": body.length }); res.end(body); }).listen(port, () => { console.log(`dummy-origin listening on https://localhost:${port}`); });