Skip to main content

PproxyUri

Struct PproxyUri 

Source
pub struct PproxyUri {
Show 20 fields pub scheme: String, pub username: Option<String>, pub password: Option<String>, pub host: String, pub port: u16, pub tls: bool, pub ssl: bool, pub inbound: bool, pub backward_num: u32, pub rule: Option<String>, pub rules_file: Option<String>, pub rule_suffix: Option<String>, pub path: Option<String>, pub protocol_chain: Vec<String>, pub transport_modifiers: Vec<String>, pub local_bind: Option<String>, pub fixed_target: Option<String>, pub plugins: Vec<PproxyPluginSpec>, pub auth_fragment: Option<String>, pub raw: String,
}
Expand description

Parsed pproxy-style URI.

Fields§

§scheme: String

Protocol scheme (e.g. “socks5”, “http”, “socks4”, “trojan”, “bind”, “listen”, “backward”).

§username: Option<String>

Optional username.

§password: Option<String>

Optional password.

§host: String

Host (empty string means bind to all interfaces).

§port: u16

Port number.

§tls: bool

Whether TLS is requested (+tls suffix).

§ssl: bool

Whether SSL modifier was used (+ssl suffix, treated as unsupported variant of +tls).

§inbound: bool

Whether this is a reverse/inbound URI (+in suffix).

§backward_num: u32

Count of +in tokens parsed from the scheme (backward connection count).

§rule: Option<String>

Optional rule parameter from query string.

§rules_file: Option<String>

Optional rules_file parameter from query string (pproxy URI-attached rule file).

§rule_suffix: Option<String>

Canonical pproxy rule suffix when the query is not rule=/rules_file=.

§path: Option<String>

Optional path (used for unix:// scheme).

§protocol_chain: Vec<String>

Protocol tokens in the original scheme, excluding transport modifiers.

§transport_modifiers: Vec<String>

Non-protocol scheme modifiers, in source order (tls, ssl, in, …).

§local_bind: Option<String>

pproxy’s optional outbound source binding (/@localbind).

§fixed_target: Option<String>

Fixed destination used by tunnel-style protocols.

§plugins: Vec<PproxyPluginSpec>

Comma-delimited plugin metadata, retained in source order.

§auth_fragment: Option<String>

Fragment authentication, kept separately from URL userinfo.

§raw: String

The raw URI, retained for diagnostics.

Implementations§

Source§

impl PproxyUri

Source

pub fn is_reverse_listener(&self) -> bool

Returns true if this is a reverse proxy listener URI (bind/listen/backward/rebind scheme).

Source

pub fn is_backward(&self) -> bool

Returns true if this is a backward/upstream URI with the +in modifier (e.g., socks5+in://...).

Source

pub fn backward_num(&self) -> u32

Returns the number of +in tokens parsed from the scheme (the backward connection count). A single +in yields 1; multiple +in+in yields 2, etc. Returns 0 if no +in modifier is present.

Source

pub fn redacted_display(&self) -> String

Redacted display — credentials shown as ****:****, Unix paths shown as unix://****.

Trait Implementations§

Source§

impl Clone for PproxyUri

Source§

fn clone(&self) -> PproxyUri

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PproxyUri

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more