Struct http_mitm_proxy::Communication
source · pub struct Communication<B> {
pub client_addr: SocketAddr,
pub request: Request<Incoming>,
pub request_back: Sender<Request<B>>,
pub response: Receiver<Response<UnboundedReceiver<Vec<u8>>>>,
pub upgrade: Receiver<Upgrade>,
}Expand description
Communication between client and server.
Note: http-mitm-proxy observe by Communication basis, not Connection basis. Some Communications may belong to the same connection using keep-alive.
Fields§
§client_addr: SocketAddrClient address
request: Request<Incoming>Request from client. request.uri() is an absolute URI.
request_back: Sender<Request<B>>Send request back to server. You can modify request before sending it back. NOTE: If you drop this without send(), communication will be canceled and server will not receive request and client will get 500 Internal Server Error.
response: Receiver<Response<UnboundedReceiver<Vec<u8>>>>Response from server. It may fail to receive response when some error occurs. Currently, not way to know the error.
upgrade: Receiver<Upgrade>Upgraded connection. Proxy will upgrade connection if and only if response status is 101.
Auto Trait Implementations§
impl<B> !RefUnwindSafe for Communication<B>
impl<B> Send for Communication<B>where
B: Send,
impl<B> Sync for Communication<B>where
B: Send,
impl<B> Unpin for Communication<B>
impl<B> !UnwindSafe for Communication<B>
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