pub struct SSEProxyConfig {
pub allowed_servers: Option<Vec<String>>,
pub authenticate: Option<AuthConfig>,
pub address: String,
pub port: u16,
pub workers: Option<usize>,
}
Expand description
Server-Sent Events (SSE) Proxy configuration
This structure defines the configuration for the SSE proxy server, which allows web clients to connect to MCP servers via HTTP and receive real-time updates through Server-Sent Events. The proxy provides authentication, server access control, and network binding options.
§Examples
Basic SSE proxy configuration with default address and port:
use mcp_runner::config::SSEProxyConfig;
let proxy_config = SSEProxyConfig {
allowed_servers: None, // Allow all servers
authenticate: None, // No authentication required
address: "127.0.0.1".to_string(),
port: 3000,
workers: None,
};
Secure SSE proxy configuration with restrictions:
use mcp_runner::config::{SSEProxyConfig, AuthConfig, BearerAuthConfig};
let auth_config = AuthConfig {
bearer: Some(BearerAuthConfig {
token: "secure_token_string".to_string(),
}),
};
let proxy_config = SSEProxyConfig {
allowed_servers: Some(vec!["fetch-server".to_string(), "embedding-server".to_string()]),
authenticate: Some(auth_config),
address: "0.0.0.0".to_string(), // Listen on all interfaces
port: 8080,
workers: Some(4),
};
Fields§
§allowed_servers: Option<Vec<String>>
List of allowed server names that clients can access
When specified, only servers in this list can be accessed through the proxy.
If None
, all servers defined in the configuration are accessible.
authenticate: Option<AuthConfig>
Authentication configuration for securing the proxy
When specified, clients must provide valid authentication credentials.
If None
, the proxy accepts all connections without authentication.
address: String
Network address the proxy server will bind to
Use “127.0.0.1” to allow only local connections, or “0.0.0.0” to accept connections from any network interface.
port: u16
TCP port the proxy server will listen on
The port must be available and not require elevated privileges (typically ports above 1024 unless running with administrator/root privileges).
workers: Option<usize>
Number of worker threads for the Actix Web server
When specified, Actix Web will use this number of workers.
If None
, the default value of 4 workers will be used.
Trait Implementations§
Source§impl Clone for SSEProxyConfig
impl Clone for SSEProxyConfig
Source§fn clone(&self) -> SSEProxyConfig
fn clone(&self) -> SSEProxyConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more