feat(infra): route Gemini WS through SOCKS5 proxy (WARP)
Some checks are pending
CI / quality (push) Waiting to run

- Add socks-proxy-agent dependency
- Add resolveGeminiProxyAgent() helper reading GEMINI_PROXY_URL env
- Apply agent to T1 and T2 Gemini WS factory defaults
- No proxy when GEMINI_PROXY_URL is unset (local dev unchanged)
- Tests: 311/311 green
This commit is contained in:
Hermann_Kitio 2026-06-30 20:30:15 +03:00
parent 74770b6402
commit 5263372839
7 changed files with 139 additions and 4 deletions

View file

@ -30,6 +30,7 @@ import {
isEndSignal,
parseAudioChunk,
reconstructTranscript,
resolveGeminiProxyAgent,
tryParseGeminiJson,
type TranscriptEntry,
type WebSocketLike,
@ -203,9 +204,14 @@ export function openGeminiLiveT1Session(
const systemPrompt = buildT1SystemPrompt();
const url = `${GEMINI_LIVE_URL}?key=${apiKey}`;
const proxyAgent = resolveGeminiProxyAgent();
const factory =
opts.clientFactory ??
((u: string) => new NodeWebSocket(u) as unknown as WebSocketLike);
((u: string) =>
new NodeWebSocket(
u,
proxyAgent ? { agent: proxyAgent } : undefined,
) as unknown as WebSocketLike);
const geminiWs = factory(url);