{"record":{"id":"b0c2c1ac1daa5dd7","repo":"diegosouzapw/OmniRoute","slug":"tproxy-capture-mode-requires-the-native-addon-lin-b0c2c1","errorCode":null,"errorMessage":"TPROXY capture mode requires the native addon (Linux + CAP_NET_ADMIN).","messagePattern":"TPROXY capture mode requires the native addon \\(Linux \\+ CAP_NET_ADMIN\\)\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/mitm/tproxy/captureMode.ts","lineNumber":164,"sourceCode":"  client.pipe(upstream);\n  upstream.pipe(client);\n}\n\n/**\n * Start TPROXY capture: apply the rules, open the transparent listener, and wire\n * the per-connection forwarder. Returns a handle whose `stop()` closes the\n * listener and reverts the rules (crash-safe teardown). Throws (after reverting)\n * if anything fails to come up.\n */\nexport async function startTproxyCapture(\n  cfg: TproxyConfig,\n  options: TproxyCaptureOptions = {}\n): Promise<TproxyCaptureHandle> {\n  const deps: TproxyDeps = { ...realDeps, ...options.deps };\n\n  // In production the native addon is required; tests inject createListenerFd.\n  if (!options.deps?.createListenerFd && !isTransparentSocketAvailable()) {\n    throw new Error(\"TPROXY capture mode requires the native addon (Linux + CAP_NET_ADMIN).\");\n  }\n  const invalid = validateTproxyConfig(cfg);\n  if (invalid) throw new Error(invalid);\n\n  await deps.applyTproxy(cfg);\n\n  // Decrypt mode: stand up the TLS-terminating engine (forwarding over the SAME\n  // bypass-marked seam, anti-loop) and install its CA so clients trust the leaves.\n  // `cleanup` is the symmetric teardown for both the error paths and stop().\n  let engine: TlsCaptureServer | undefined;\n  let uninstallCa: (() => Promise<void>) | undefined;\n  const cleanup = async (): Promise<void> => {\n    await engine?.close().catch(() => {});\n    await uninstallCa?.().catch(() => {});\n    await deps.revertTproxy(cfg).catch(() => {});\n  };\n\n  try {","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/mitm/tproxy/captureMode.ts#L146-L182","documentation":"Error \"TPROXY capture mode requires the native addon (Linux + CAP_NET_ADMIN).\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/mitm/tproxy/captureMode.ts:164 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}