pub enum ProxyMode {
Off,
Required {
versions: ProxyVersions,
},
}Expand description
Whether a listener expects a PROXY protocol header.
There is no optional mode: the PROXY specification says a receiver must be configured for the protocol and must not guess whether a header is present.
§Examples
use net_io::{ProxyMode, ProxyVersions};
assert_eq!(ProxyMode::default(), ProxyMode::Off);
let mode = ProxyMode::Required { versions: ProxyVersions::Both };
assert_ne!(mode, ProxyMode::Off);Variants§
Off
No header is expected.
Required
Every connection must start with a header from a trusted proxy.
Fields
§
versions: ProxyVersionsWhich versions are accepted.
Trait Implementations§
impl Copy for ProxyMode
impl Eq for ProxyMode
impl StructuralPartialEq for ProxyMode
Auto Trait Implementations§
impl Freeze for ProxyMode
impl RefUnwindSafe for ProxyMode
impl Send for ProxyMode
impl Sync for ProxyMode
impl Unpin for ProxyMode
impl UnsafeUnpin for ProxyMode
impl UnwindSafe for ProxyMode
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