diegosouzapw/OmniRoute · error
Bad Gateway
Error message
Bad Gateway
What it means
Error "Bad Gateway" thrown in diegosouzapw/OmniRoute.
Source
Thrown at src/mitm/inspector/httpProxyServer.ts:162
intercepted.proxyLatencyMs = 0;
const safeRespHeaders: Record<string, string> = {};
upstream.headers.forEach((value, key) => {
if (key.toLowerCase() === "content-length") return;
if (key.toLowerCase() === "transfer-encoding") return;
safeRespHeaders[key] = value;
});
res.writeHead(upstream.status, safeRespHeaders);
res.end(respBuf);
globalTrafficBuffer.update(intercepted.id, intercepted);
} catch (err) {
intercepted.status = "error";
intercepted.error = sanitizeErrorMessage(err);
intercepted.totalLatencyMs = performance.now() - startedAt;
globalTrafficBuffer.update(intercepted.id, intercepted);
if (!res.headersSent) {
res.writeHead(502, { "content-type": "text/plain" });
res.end("Bad Gateway");
} else {
res.end();
}
}
})();
}
function handleConnect(
req: http.IncomingMessage,
clientSocket: net.Socket,
head: Buffer
): void {
const target = req.url ?? "";
const [host, rawPort] = target.split(":");
const port = Number(rawPort) || 443;
const intercepted: InterceptedRequest = {View on GitHub (pinned to a179ffed5b)
When it happens
Trigger: Thrown at src/mitm/inspector/httpProxyServer.ts:162 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- HTTP status errors: handling 4xx and 5xx responses — how to handle 4xx and 5xx responses properly.
AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25).
Data as JSON: /api/errors/a6e4fc7950fe63e2.
Report an issue: GitHub.