pub struct Proxy {
pub proxy_type: ProxyType,
pub host: String,
pub port: u16,
pub username: Option<String>,
pub password: Option<String>,
}Expand description
Proxy configuration for an outgoing HTTP / WebSocket request.
Proxy is a value type with no Arc<RwLock> wrapping — exactly like
hyperlane-core’s plain fields. Construct one with the convenience
constructors below, then pass to RequestBuilder::proxy(...) or assign
directly to RequestConfig::proxy.
§Examples
ⓘ
use http_request::Proxy;
let p = Proxy::https("proxy.example.com", 7890);
let auth = Proxy::socks5("127.0.0.1", 1080).auth("user", "pass");Fields§
§proxy_type: ProxyTypeProxy protocol family.
host: StringProxy server hostname or IP.
port: u16Proxy server port.
username: Option<String>Optional username for proxy auth.
password: Option<String>Optional password for proxy auth.
Implementations§
Source§impl Proxy
impl Proxy
pub fn get_proxy_type(&self) -> &ProxyType
pub fn get_mut_proxy_type(&mut self) -> &mut ProxyType
pub fn set_proxy_type(&mut self, val: ProxyType) -> &mut Self
pub fn get_host(&self) -> &String
pub fn get_mut_host(&mut self) -> &mut String
pub fn set_host(&mut self, val: String) -> &mut Self
pub fn get_port(&self) -> &u16
pub fn get_mut_port(&mut self) -> &mut u16
pub fn set_port(&mut self, val: u16) -> &mut Self
pub fn get_username(&self) -> String
pub fn try_get_username(&self) -> &Option<String>
pub fn get_mut_username(&mut self) -> &mut Option<String>
pub fn set_username(&mut self, val: Option<String>) -> &mut Self
pub fn get_password(&self) -> String
pub fn try_get_password(&self) -> &Option<String>
pub fn get_mut_password(&mut self) -> &mut Option<String>
pub fn set_password(&mut self, val: Option<String>) -> &mut Self
Trait Implementations§
impl Eq for Proxy
impl StructuralPartialEq for Proxy
Auto Trait Implementations§
impl Freeze for Proxy
impl RefUnwindSafe for Proxy
impl Send for Proxy
impl Sync for Proxy
impl Unpin for Proxy
impl UnsafeUnpin for Proxy
impl UnwindSafe for Proxy
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone for T
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