{"record":{"id":"577a4238aca5aaf9","repo":"diegosouzapw/OmniRoute","slug":"tproxy-capture-mode-requires-the-native-addon-lin","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":"Error","httpStatus":null,"severity":"error","filePath":"src/mitm/tproxy/captureManager.ts","lineNumber":78,"sourceCode":"  startedAt: string;\n  intercepts: { count: number };\n}\n\nlet active: ActiveCapture | null = null;\n\n/**\n * Start the decrypt-capable TPROXY capture mode. Rejects if a session is already\n * running or the native addon is unavailable. The dynamic CA is created here and\n * installed in the trust store via the injected `installCa`.\n */\nexport async function startCaptureMode(\n  options: StartCaptureModeOptions\n): Promise<CaptureManagerStatus> {\n  if (active) throw new Error(\"TPROXY capture mode is already running\");\n\n  const deps: CaptureManagerDeps = { ...realDeps, ...options.deps };\n  if (!deps.isAvailable()) {\n    throw new Error(\"TPROXY capture mode requires the native addon (Linux + CAP_NET_ADMIN).\");\n  }\n\n  const certStore = deps.createCertStore();\n  const intercepts = { count: 0 };\n  const handle = await deps.startTproxyCapture(options.cfg, {\n    decrypt: { certStore, installCa: options.installCa, uninstallCa: options.uninstallCa },\n    onIntercept: () => {\n      intercepts.count += 1;\n    },\n  });\n  active = { handle, startedAt: deps.now(), intercepts };\n  return getCaptureStatus();\n}\n\n/** Stop the running capture session (closes the listener, uninstalls the CA, and\n * reverts the rules via the handle). Idempotent — a no-op when nothing runs. */\nexport async function stopCaptureMode(): Promise<CaptureManagerStatus> {\n  const current = active;","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/mitm/tproxy/captureManager.ts#L60-L96","documentation":"Error \"TPROXY capture mode requires the native addon (Linux + CAP_NET_ADMIN).\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/mitm/tproxy/captureManager.ts:78 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"}