pub struct MitmRequest {
pub source: Option<SocketAddr>,
pub destination: String,
pub timestamp: u64,
pub request: Request,
/* private fields */
}Expand description
MITM Request wrapper that wraps slinger::Request with connection metadata. Used for both HTTP and non-HTTP (raw TCP) traffic interception.
Fields§
§source: Option<SocketAddr>Source address and port (client)
destination: StringDestination address (host:port)
timestamp: u64Timestamp when the request was intercepted
request: RequestThe underlying request (contains body for both HTTP and raw TCP)
Implementations§
Source§impl MitmRequest
impl MitmRequest
Sourcepub fn new(destination: impl Into<String>, request: Request) -> Self
pub fn new(destination: impl Into<String>, request: Request) -> Self
Create a new MITM request wrapper for HTTP traffic
Sourcepub fn with_source(
source: SocketAddr,
destination: impl Into<String>,
request: Request,
) -> Self
pub fn with_source( source: SocketAddr, destination: impl Into<String>, request: Request, ) -> Self
Create a new MITM request with source address for HTTP traffic
Sourcepub fn raw_tcp(destination: impl Into<String>, body: impl Into<Bytes>) -> Self
pub fn raw_tcp(destination: impl Into<String>, body: impl Into<Bytes>) -> Self
Create a MITM request for raw TCP data (non-HTTP)
Sourcepub fn raw_tcp_with_source(
source: SocketAddr,
destination: impl Into<String>,
body: impl Into<Bytes>,
) -> Self
pub fn raw_tcp_with_source( source: SocketAddr, destination: impl Into<String>, body: impl Into<Bytes>, ) -> Self
Create a MITM request for raw TCP data with source address
Sourcepub fn source(&self) -> Option<SocketAddr>
pub fn source(&self) -> Option<SocketAddr>
Get the source address
Sourcepub fn destination(&self) -> &str
pub fn destination(&self) -> &str
Get the destination address
Sourcepub fn request_mut(&mut self) -> &mut Request
pub fn request_mut(&mut self) -> &mut Request
Get a mutable reference to the underlying request
Trait Implementations§
Source§impl Clone for MitmRequest
impl Clone for MitmRequest
Source§fn clone(&self) -> MitmRequest
fn clone(&self) -> MitmRequest
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 moreAuto Trait Implementations§
impl !Freeze for MitmRequest
impl RefUnwindSafe for MitmRequest
impl Send for MitmRequest
impl Sync for MitmRequest
impl Unpin for MitmRequest
impl UnwindSafe for MitmRequest
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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