pub struct ReverseClient { /* private fields */ }Expand description
A reverse proxy control client.
Connects to a reverse server, authenticates, and services incoming proxy requests by connecting to local targets and relaying data.
In pproxy’s backward model, each control connection carries exactly one proxy session. When the session ends, the client reconnects.
Implementations§
Source§impl ReverseClient
impl ReverseClient
pub fn new(config: ReverseClientConfig) -> Self
Sourcepub fn set_metrics(&mut self, metrics: Arc<ReverseMetrics>)
pub fn set_metrics(&mut self, metrics: Arc<ReverseMetrics>)
Attach metrics to this client instance.
Sourcepub fn set_resolver(&mut self, resolver: Arc<dyn TargetResolver>)
pub fn set_resolver(&mut self, resolver: Arc<dyn TargetResolver>)
Replace the target resolver (defaults to DefaultTargetResolver).
Sourcepub fn cancel_token(&self) -> CancellationToken
pub fn cancel_token(&self) -> CancellationToken
Get a cancel token for external shutdown.
Sourcepub async fn run(&self) -> Result<(), ProtocolError>
pub async fn run(&self) -> Result<(), ProtocolError>
Run the reverse client with automatic reconnection.
Auto Trait Implementations§
impl !RefUnwindSafe for ReverseClient
impl !UnwindSafe for ReverseClient
impl Freeze for ReverseClient
impl Send for ReverseClient
impl Sync for ReverseClient
impl Unpin for ReverseClient
impl UnsafeUnpin for ReverseClient
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