pub struct ProxyConfig {
pub listen_addr: SocketAddr,
pub target_addr: SocketAddr,
pub tls_enabled: bool,
pub tls_cert_file: Option<PathBuf>,
pub tls_key_file: Option<PathBuf>,
pub block_mode: bool,
pub log_file: Option<PathBuf>,
pub min_block_severity: Severity,
pub verbose: bool,
}Expand description
Configuration for the proxy server.
Fields§
§listen_addr: SocketAddrAddress to listen on
target_addr: SocketAddrTarget MCP server address
tls_enabled: boolEnable TLS termination
tls_cert_file: Option<PathBuf>TLS certificate file (optional, will generate self-signed if not provided)
tls_key_file: Option<PathBuf>TLS key file (optional)
block_mode: boolBlock mode: if true, block messages with findings; if false, log only
log_file: Option<PathBuf>Log file path for JSONL output
min_block_severity: SeverityMinimum severity to trigger blocking (when block_mode is true)
verbose: boolVerbose logging
Implementations§
Source§impl ProxyConfig
impl ProxyConfig
Sourcepub fn new(listen_addr: SocketAddr, target_addr: SocketAddr) -> Self
pub fn new(listen_addr: SocketAddr, target_addr: SocketAddr) -> Self
Create a new proxy config with the given listen and target addresses.
Sourcepub fn with_tls_files(self, cert: PathBuf, key: PathBuf) -> Self
pub fn with_tls_files(self, cert: PathBuf, key: PathBuf) -> Self
Enable TLS with custom certificate files.
Sourcepub fn with_block_mode(self, min_severity: Severity) -> Self
pub fn with_block_mode(self, min_severity: Severity) -> Self
Enable block mode.
Sourcepub fn with_log_file(self, path: PathBuf) -> Self
pub fn with_log_file(self, path: PathBuf) -> Self
Set log file path.
Sourcepub fn with_verbose(self) -> Self
pub fn with_verbose(self) -> Self
Enable verbose logging.
Trait Implementations§
Source§impl Clone for ProxyConfig
impl Clone for ProxyConfig
Source§fn clone(&self) -> ProxyConfig
fn clone(&self) -> ProxyConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProxyConfig
impl Debug for ProxyConfig
Auto Trait Implementations§
impl Freeze for ProxyConfig
impl RefUnwindSafe for ProxyConfig
impl Send for ProxyConfig
impl Sync for ProxyConfig
impl Unpin for ProxyConfig
impl UnwindSafe for ProxyConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more