pub struct Intercept { /* private fields */ }
Expand description
A matched proxy,
This is returned by a matcher if a proxy should be used.
Implementations§
Source§impl Intercept
impl Intercept
Sourcepub fn basic_auth(&self) -> Option<&HeaderValue>
pub fn basic_auth(&self) -> Option<&HeaderValue>
Get any configured basic authorization.
This should usually be used with a Proxy-Authorization
header, to
send in Basic format.
§Example
let m = Matcher::builder()
.all("https://Aladdin:opensesame@localhost:8887")
.build();
let proxy = m.intercept(&uri).expect("example");
let auth = proxy.basic_auth().expect("example");
assert_eq!(auth, "Basic QWxhZGRpbjpvcGVuc2VzYW1l");
Sourcepub fn raw_auth(&self) -> Option<(&str, &str)>
pub fn raw_auth(&self) -> Option<(&str, &str)>
Get any configured raw authorization.
If not detected as another scheme, this is the username and password that should be sent with whatever protocol the proxy handshake uses.
§Example
let m = Matcher::builder()
.all("socks5h://Aladdin:opensesame@localhost:8887")
.build();
let proxy = m.intercept(&uri).expect("example");
let auth = proxy.raw_auth().expect("example");
assert_eq!(auth, ("Aladdin", "opensesame"));
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Intercept
impl RefUnwindSafe for Intercept
impl Send for Intercept
impl Sync for Intercept
impl Unpin for Intercept
impl UnwindSafe for Intercept
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