mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-26 00:52:18 +03:00
Integrated into release/v3.8.8. Applied review fixes: moved the SELECT 1 into a pingDb() db helper (no raw SQL in route, Hard Rule #5) + the 503 catch no longer leaks err.message (Hard Rule #12). Thanks @herjarsa!
38 lines
1.2 KiB
TypeScript
38 lines
1.2 KiB
TypeScript
/**
|
|
* Claude Code (Anthropic CLI) — MITM target descriptor.
|
|
*
|
|
* Hosts: `api.anthropic.com`.
|
|
* Format: Anthropic Messages API on `/v1/messages`.
|
|
*
|
|
* NOTE: shares the host `api.anthropic.com` with the Kiro target. The DNS-routing
|
|
* tutorial therefore is opt-in: the user explicitly enables interception when
|
|
* they want Claude Code traffic captured.
|
|
*/
|
|
import type { MitmTarget } from "../types";
|
|
|
|
export const CLAUDE_CODE_TARGET: MitmTarget = {
|
|
id: "claude-code",
|
|
name: "Claude Code",
|
|
icon: "terminal",
|
|
color: "#D97706",
|
|
hosts: ["api.anthropic.com"],
|
|
port: 443,
|
|
endpointPatterns: ["/v1/messages"],
|
|
defaultModels: [
|
|
{ id: "claude-sonnet-4.5", name: "Claude Sonnet 4.5", alias: "claude-sonnet-4.5" },
|
|
{ id: "claude-opus-4.5", name: "Claude Opus 4.5", alias: "claude-opus-4.5" },
|
|
],
|
|
setupTutorial: {
|
|
steps: [
|
|
"Install Claude Code (Anthropic CLI)",
|
|
"Install OmniRoute's root certificate",
|
|
"Enable DNS routing for Claude Code",
|
|
"Run `claude` — requests are now proxied via OmniRoute",
|
|
],
|
|
detection: { command: "which claude", platform: "all" },
|
|
},
|
|
handler: () =>
|
|
import("../handlers/claudeCode").then((m) => ({ default: m.ClaudeCodeHandler })),
|
|
riskNoticeKey: "providers.riskNotice.oauth",
|
|
};
|