Skip to content

Commit

Permalink
fix: Use from_proxy_unsecured for no-tls and native-tls in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
siketyan committed Jan 14, 2024
1 parent d2cf0fe commit 47231a8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions examples/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ async fn main() -> Result<(), Box<dyn Error>> {
let mut proxy = Proxy::new(Intercept::All, proxy_uri);
proxy.set_authorization(Authorization::basic("John Doe", "Agent1234"));
let connector = HttpConnector::new();

#[cfg(not(any(feature = "tls", feature = "rustls-base", feature = "openssl-tls")))]
let proxy_connector = ProxyConnector::from_proxy_unsecured(connector, proxy);

#[cfg(any(feature = "tls", feature = "rustls-base", feature = "openssl"))]
let proxy_connector = ProxyConnector::from_proxy(connector, proxy).unwrap();

proxy_connector
};

Expand Down

0 comments on commit 47231a8

Please sign in to comment.