Skip to main content

Module proxy_endpoint

Module proxy_endpoint 

Source
Expand description

Where the local lean-ctx proxy listens and whether it answers.

The engine (updater, autostart, gain) and the setup/doctor surfaces share this single source of truth for the proxy port, the reachability timeout and the “is the proxy up” check.

Constants§

DEFAULT_PROXY_PORT

Functions§

configured_proxy_live
Single source of truth for “is the proxy up” across doctor, status and gain: the proxy must be enabled in config AND the configured endpoint must answer as a lean-ctx proxy.
default_port
lean_ctx_proxy_responding
True when the lean-ctx proxy itself answers GET /health on port. An open port alone proves nothing: a foreign process (or another user’s proxy) listening there must never count as “proxy up”.
proxy_timeout
Proxy reachability timeout. Priority: env var > config.toml > 200ms default.
uid_based_port
Derives a deterministic port from the user’s UID to avoid collisions on multi-user systems. uid 1000 → 4444, uid 1001 → 4445, etc. System accounts (uid < 1000) and root always get the base port 4444.