Module: Clacky::ProxyConfig
- Defined in:
- lib/clacky/proxy_config.rb
Overview
Centralized HTTP proxy policy for the current process.
Single source of truth: AgentConfig#proxy_url. We never honour the user’s shell ENV (HTTP_PROXY etc.) — it’s stripped on every install! so a stale proxy in the launching shell can’t poison Clacky.
epoch increments on every actual change so that long-lived consumers (e.g. Faraday connections cached on Client instances) can detect when their cached state is stale and rebuild.
Constant Summary collapse
- PROXY_ENV_KEYS =
%w[ http_proxy HTTP_PROXY https_proxy HTTPS_PROXY all_proxy ALL_PROXY ].freeze
Class Attribute Summary collapse
-
.epoch ⇒ Object
readonly
Returns the value of attribute epoch.
Class Method Summary collapse
Class Attribute Details
.epoch ⇒ Object (readonly)
Returns the value of attribute epoch.
24 25 26 |
# File 'lib/clacky/proxy_config.rb', line 24 def epoch @epoch end |
Class Method Details
.install! ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/clacky/proxy_config.rb', line 26 def install! url = load_proxy_url sig = url return if sig == @installed_signature strip_env_proxy assign_env_proxy(url) if url && !url.empty? ensure_faraday_reads_env @installed_signature = sig @epoch += 1 end |
.reset_cache! ⇒ Object
39 40 41 42 |
# File 'lib/clacky/proxy_config.rb', line 39 def reset_cache! @installed_signature = nil install! end |