Files
PaperClipAI/tests/exe-dev-live/relay.ts
DottaandPaperclip 28af5a420c test: support a persistent runner-only WSS relay for exe campaigns
Avoid accountless quick-tunnel rate limits with per-harness registrations behind one TLS endpoint. Preserve capability authentication and reject non-runner traffic.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-17 11:14:10 -05:00

10 lines
719 B
TypeScript

/** Optional persistent WSS relay for paid campaigns that exceed quick-tunnel limits.
* Expose this loopback listener through an operator-owned TLS/SSH relay. */
import { createRunnerWssRelay } from "../runner-e2e/runner-wss-relay.js";
const registry = process.env.PAPERCLIP_E2E_RUNNER_RELAY_REGISTRY;
if (!registry) throw new Error("PAPERCLIP_E2E_RUNNER_RELAY_REGISTRY is required");
const port = Number(process.env.PAPERCLIP_E2E_RUNNER_RELAY_PORT ?? 35000);
const server = createRunnerWssRelay(registry);
server.listen(port, "127.0.0.1", () => console.log(`Runner-only relay on 127.0.0.1:${port}`));
for (const signal of ["SIGINT", "SIGTERM"] as const) process.on(signal, () => server.close(() => process.exit(0)));