Documentation
¶
Overview ¶
Package pac is the PAC (proxy auto-config) engine: the persisted PAC configuration store and the FindProxyForURL generator. Extracted from package main per ADR-0002; the HTTP handlers, route registration, and the pacStore singleton stay in main (pac.go shim). The former pacDefaultProxyPort package global is now a Store field (SetDefaultPort), set once by the startup slice.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// ProxyHost is the hostname or IP of this proxy, e.g. "proxy.corp.com".
// If empty the /proxy.pac endpoint uses the hostname from the request's
// Host header (stripping the port, which belongs to the UI — not the proxy).
ProxyHost string `json:"proxyHost"`
// ProxyPort is the port the proxy server listens on.
// If zero it falls back to the runtime proxy port set at startup.
ProxyPort int `json:"proxyPort"`
// Exclusions is the list of host patterns that should bypass the proxy.
// Supports bare domains ("corp.local"), wildcard prefixes ("*.corp.local"),
// and IP CIDR ranges ("192.168.0.0/16").
Exclusions []string `json:"exclusions"`
}
Config is the persisted PAC configuration.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store persists Config to a JSON file.
func (*Store) DefaultPort ¶
DefaultPort returns the startup-time fallback proxy port (0 if unset).
func (*Store) GeneratePAC ¶
GeneratePAC builds the PAC JavaScript. proxyAddr is the "host:port" string to use when ProxyHost is empty (caller passes the request's Host as a fallback).
func (*Store) SetDefaultPort ¶
SetDefaultPort records the runtime proxy listening port used as the fallback when Config.ProxyPort is zero. Called once by the startup slice.