Skip to main content

Module proxy

Module proxy 

Source
Expand description

Client-facing protocol handlers. The pool checks out server connections; this module decides what to do with them — classify queries, intercept session-affecting commands, forward messages, and translate between client-visible prepared statement names and the pool-wide canonical ones.

Modules§

frontend
Per-client wire-protocol entry point. Drives the PostgreSQL startup handshake (SSL/GSS negotiation, StartupMessage parsing, cancel forwarding), authenticates, checks out an initial server connection, sets up multiplexed LISTEN when configured, and dispatches to crate::proxy::session::forward or crate::proxy::transaction::forward based on the pool mode.
intercept
Message interceptors that produce synthetic client-facing responses without involving the upstream server. Each handler either consumes the message (returns true) or defers it to the normal forwarding path (returns false).
prepared
Per-client prepared statement state and server-side rewriting.
session
transaction
Transaction-mode proxy: the outer loop cycles between an idle state (no server connection) and an active state (holding a checked-out crate::connections::server::ServerConn for the duration of a single transaction). On ReadyForQuery(Idle) the connection is returned to the pool; on Terminate or disconnect the loop exits.