pub struct Proxy<'a> {
pub policy: &'a CompiledPolicy<'a>,
pub resolver: &'a dyn Resolve,
pub recorder: &'a dyn Recorder,
pub limits: &'a Limits,
pub broker: &'a Broker,
pub loopback_ok: &'a [SocketAddr],
pub allow_ech: bool,
pub sessions: Option<&'a Sessions<'a>>,
pub local: Option<&'a dyn LocalService>,
pub tls: Option<&'a Tls>,
}Expand description
The proxy: a policy, a resolver, an audit sink and limits.
Fields§
§policy: &'a CompiledPolicy<'a>The policy hosts are decided by.
resolver: &'a dyn ResolveName resolution.
recorder: &'a dyn RecorderWhere every decision is recorded.
limits: &'a LimitsResource limits.
broker: &'a BrokerBrokered secrets; Broker::default for none.
loopback_ok: &'a [SocketAddr]Loopback addresses the proxy may connect to despite the loopback ban.
Empty in moat proxy; integration tests list their local server.
allow_ech: boolForward a ClientHello that carries an encrypted server name (ECH,
ESNI); refused when false (sandbox.proxy_allow_ech).
sessions: Option<&'a Sessions<'a>>Session mode (ADR-027, ADR-044): every request must carry one of these
credentials, and is decided with that session’s taint and connection
share. None serves any local client with no session; moat run and
moat proxy always serve sessions.
local: Option<&'a dyn LocalService>A service of this process that shares the port (ADR-028): moat run
answers its sandboxed hooks here. None in moat proxy.
tls: Option<&'a Tls>TLS termination (ADR-043): a CONNECT to the host of a secret that says
tls: terminate is decrypted, and each request in it checked, given
the value and recorded. None: every tunnel is relayed as it is, as
in moat proxy, whose clients cannot be made to trust the CA.