pub struct ProxyConnector { /* private fields */ }Expand description
A tower_service::Service<Uri> that connects through an HTTP CONNECT proxy.
On call(target_uri) it:
- Opens a TCP connection to the configured proxy.
- Sends
CONNECT target_host:target_port HTTP/1.1with optionalProxy-Authorization: Basic ...when credentials are present in the proxy URI. - Reads the proxy’s
HTTP/1.1 200 ...response. - Returns the raw TCP stream, ready for further use (plain HTTP or TLS).
Implementations§
Source§impl ProxyConnector
impl ProxyConnector
Sourcepub fn new(proxy_uri: Uri, connect_timeout: Option<Duration>) -> Self
pub fn new(proxy_uri: Uri, connect_timeout: Option<Duration>) -> Self
Create a new ProxyConnector.
proxy_uri is the address of the HTTP CONNECT proxy server (e.g.
http://proxy.example.com:8080). User/password credentials in the URI
userinfo are automatically extracted and used as Proxy-Authorization.
Trait Implementations§
Source§impl Clone for ProxyConnector
impl Clone for ProxyConnector
Source§fn clone(&self) -> ProxyConnector
fn clone(&self) -> ProxyConnector
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProxyConnector
impl Debug for ProxyConnector
Source§impl Service<Uri> for ProxyConnector
impl Service<Uri> for ProxyConnector
Source§type Error = OxiHttpError
type Error = OxiHttpError
Errors produced by the service.
Source§type Future = Pin<Box<dyn Future<Output = Result<<ProxyConnector as Service<Uri>>::Response, <ProxyConnector as Service<Uri>>::Error>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<<ProxyConnector as Service<Uri>>::Response, <ProxyConnector as Service<Uri>>::Error>> + Send>>
The future response value.
Auto Trait Implementations§
impl !Freeze for ProxyConnector
impl RefUnwindSafe for ProxyConnector
impl Send for ProxyConnector
impl Sync for ProxyConnector
impl Unpin for ProxyConnector
impl UnsafeUnpin for ProxyConnector
impl UnwindSafe for ProxyConnector
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