Documentation
¶
Overview ¶
Package clientmeta extracts originating-client metadata (IP, codex version, OS) from inbound HTTP requests. Used by both codex-exec-gateway (executors connecting from user laptops) and codex-app-gateway (codex --remote CLI sessions) so the Browsers + Connectors UI columns derive from identical logic.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientIP ¶
ClientIP returns the best-effort originating client IP for an inbound HTTP request. The kube ingress chain prepends entries to X-Forwarded-For ("client, proxy1, proxy2"); the first non-empty hop is the real client. Falls back to X-Real-IP, then r.RemoteAddr (host:port) with the port stripped.
func ParseCodexUA ¶
ParseCodexUA extracts the codex CLI version and host OS from the User-Agent string of a codex client (exec-server inbound or `codex --remote` ws). Upstream codex's reqwest client sends UAs shaped like:
codex_cli_rs/0.130.0 (Darwin 24.4.0; arm64) codex_cli_rs/0.128.0 (Linux 6.5.0-15-generic; x86_64)
We pattern-match conservatively and return ("", "") on anything we don't recognise so callers can store NULL and the UI shows "—".
Types ¶
This section is empty.