diegosouzapw/OmniRoute · error · Error

system proxy apply failed

Error message

system proxy apply failed

What it means

Error "system proxy apply failed" thrown in diegosouzapw/OmniRoute.

Source

Thrown at src/mitm/inspector/systemProxyConfig.ts:275

// ────────────────────────────────────────────────────────────────────────────

/**
 * Apply OmniRoute as the system-wide HTTP/HTTPS proxy at `127.0.0.1:<port>`.
 * Captures and returns the prior configuration so callers can revert later.
 *
 * Throws a sanitized `Error` if the underlying command fails (no stack/path
 * leakage — see Hard Rule #12).
 */
export async function apply(port: number): Promise<ApplyResult> {
  const platform = detectPlatform();
  try {
    let previousState: PreviousState;
    if (platform === "macos") previousState = await macosApply(port);
    else if (platform === "windows") previousState = await windowsApply(port);
    else previousState = await linuxApply(port);
    return { platform, previousState };
  } catch (err) {
    throw new Error(sanitizeErrorMessage(err) || "system proxy apply failed");
  }
}

/**
 * Restore the prior configuration captured by `apply()`. No-op if the
 * `previousState` payload does not match a known platform.
 */
export async function revert(previousState: PreviousState | unknown): Promise<void> {
  if (!previousState || typeof previousState !== "object") return;
  const state = previousState as Record<string, unknown>;
  const platform = state.platform;
  try {
    if (platform === "macos") await macosRevert(state as unknown as MacOsPreviousState);
    else if (platform === "linux") await linuxRevert(state as unknown as LinuxPreviousState);
    else if (platform === "windows") await windowsRevert(state as unknown as WindowsPreviousState);
  } catch (err) {
    throw new Error(sanitizeErrorMessage(err) || "system proxy revert failed");
  }

View on GitHub (pinned to a179ffed5b)

When it happens

Trigger: Thrown at src/mitm/inspector/systemProxyConfig.ts:275 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/ed0f423b751a5565. Report an issue: GitHub.