mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-03 13:52:09 +03:00
The proxy logs captured the INBOUND client IP (x-forwarded-for) but never the
OUTBOUND/egress IP — so there was no way to confirm by which IP each account
leaves. For rotating providers that is the whole game: probing the servers
showed every codex account had a distinct proxy assigned, but ALL proxies were
dead (egress timeout) while still marked status=active, so accounts fell back
to the shared host IPv6 /64 (same /64 across .16/.17/.18) → OpenAI anomaly
revocation ("authentication token has been invalidated").
- src/lib/proxyEgress.ts: resolveEgressIp() (echo-IP via the resolved proxy,
cached), analyzeEgressSharing() (flags >=2 same-rotation-group accounts on
one egress IP), diagnoseAllEgressIps(), and validateProxyPool() (probes each
proxy and persists status=active/error so the dead-proxy filter takes them out
of rotation automatically).
- proxyLogger: new egressIp field + a structured [ProxyEgress] line
(in=clientIp out=egressIp) so the proxy logs show entry AND exit IP.
- chatHelpers: populate egressIp from a non-blocking cache, warm in background.
- GET/POST /api/settings/proxies/egress: diagnose + validate from the dashboard.
TDD: 5 tests (egress resolve/cache, sharing analysis, diagnose wiring, pool
validation). 37/37 proxy+oauth tests green, typecheck:core=0, lint clean.