{"record":{"id":"21e049977a7c53d6","repo":"diegosouzapw/OmniRoute","slug":"tproxy-capture-mode-is-already-running","errorCode":null,"errorMessage":"TPROXY capture mode is already running","messagePattern":"TPROXY capture mode is already running","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/mitm/tproxy/captureManager.ts","lineNumber":74,"sourceCode":"}\n\ninterface ActiveCapture {\n  handle: TproxyCaptureHandle;\n  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","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/mitm/tproxy/captureManager.ts#L56-L92","documentation":"Error \"TPROXY capture mode is already running\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/mitm/tproxy/captureManager.ts:74 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"}