pub struct ProxyCore {
pub config: Arc<Config>,
pub client: Client,
pub router: Arc<dyn Router>,
pub global_filters: Arc<RwLock<Vec<Arc<dyn Filter>>>>,
pub security_chain: Arc<RwLock<SecurityChain>>,
}
Expand description
Core proxy server implementation.
Fields§
§config: Arc<Config>
Configuration for the proxy
client: Client
HTTP client for making outbound requests
router: Arc<dyn Router>
Router for matching requests to routes
global_filters: Arc<RwLock<Vec<Arc<dyn Filter>>>>
Global filters that apply to all routes
security_chain: Arc<RwLock<SecurityChain>>
Security chain that applies to all routes
Implementations§
Source§impl ProxyCore
impl ProxyCore
Sourcepub async fn new(
config: Arc<Config>,
router: Arc<dyn Router>,
) -> Result<Self, ProxyError>
pub async fn new( config: Arc<Config>, router: Arc<dyn Router>, ) -> Result<Self, ProxyError>
Create a new proxy core with the given configuration and router.
Sourcepub async fn add_global_filter(&self, filter: Arc<dyn Filter>)
pub async fn add_global_filter(&self, filter: Arc<dyn Filter>)
Add a global filter.
Sourcepub async fn add_security_provider(&self, p: Arc<dyn SecurityProvider>)
pub async fn add_security_provider(&self, p: Arc<dyn SecurityProvider>)
Add a security filter to the chain.
Sourcepub async fn process_request(
&self,
request: ProxyRequest,
) -> Result<ProxyResponse, ProxyError>
pub async fn process_request( &self, request: ProxyRequest, ) -> Result<ProxyResponse, ProxyError>
Process a request through the proxy.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProxyCore
impl !RefUnwindSafe for ProxyCore
impl Send for ProxyCore
impl Sync for ProxyCore
impl Unpin for ProxyCore
impl !UnwindSafe for ProxyCore
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