pub struct PproxyArgs {Show 25 fields
pub local: Vec<String>,
pub remotes: Vec<String>,
pub verbose_level: u8,
pub debug: bool,
pub debug_level: u8,
pub daemon: bool,
pub reuse_port: bool,
pub auth_timeout: Option<Duration>,
pub system_proxy: bool,
pub help: bool,
pub version: bool,
pub known_unsupported: Vec<String>,
pub ssl: Option<String>,
pub pac: Option<String>,
pub test_value: Option<String>,
pub udp_listen: Vec<String>,
pub udp_remote: Vec<String>,
pub scheduler: Option<String>,
pub alive: Option<String>,
pub block_values: Vec<String>,
pub log_values: Vec<String>,
pub rulefile_values: Vec<String>,
pub get_values: Vec<String>,
pub unknown_flags: Vec<String>,
pub strict_violations: Vec<String>,
}Expand description
Parsed pproxy-compatible CLI arguments.
Fields§
§local: Vec<String>Local listener URIs (from -l flags).
remotes: Vec<String>Remote/upstream URIs (from -r flags).
verbose_level: u8Verbosity level derived from -v/-vv/-vvv flags.
debug: bool-d flag: debug-level compatibility diagnostics.
debug_level: u8Number of -d occurrences, including clustered short options.
daemon: bool--daemon flag: daemon mode request (unsupported).
reuse_port: bool--reuse flag: listener SO_REUSEPORT.
auth_timeout: Option<Duration>--auth <seconds>: per-client authentication reuse interval.
system_proxy: bool--sys flag: apply the selected compatibility listener as the system proxy.
help: bool-h/--help was requested.
version: bool--version was requested.
known_unsupported: Vec<String>Known pproxy flags that require a translation decision, kept as raw
key=value strings for back-compat.
Legacy name: despite unsupported in the name, this bucket carries
supported/native-equivalent options too (ssl=, pac=,
udp-listen=, …). It stays populated so existing API readers keep
working, but authoritative state lives in the structured fields
below. Internal translation and presentation code must consume the
structured fields/accessors, never scan these strings.
ssl: Option<String>--ssl CERT,KEY raw value, if requested. Structured owner of the
ssl= legacy bucket entry; drives TLS translation and the startup
banner.
pac: Option<String>--pac PATH raw value, if requested. Structured owner of the pac=
legacy bucket entry; drives admin PAC translation and the banner.
test_value: Option<String>--test URL raw value, if this invocation is a diagnostic probe.
Structured owner of the test= legacy bucket entry.
udp_listen: Vec<String>-ul UDP listener values in declaration order. Structured owner of
the udp-listen= legacy bucket entries.
udp_remote: Vec<String>-ur UDP upstream values in declaration order. Structured owner of
the udp-remote= legacy bucket entries.
scheduler: Option<String>-s scheduler value, if given. Structured owner of the scheduler=
legacy bucket entry.
alive: Option<String>-a alive/health-check interval value, if given. Structured owner of
the alive= legacy bucket entry.
block_values: Vec<String>-b block pattern values in declaration order. Structured owner of
the block= legacy bucket entries.
log_values: Vec<String>--log values in declaration order. Structured owner of the log=
legacy bucket entries.
rulefile_values: Vec<String>--rulefile values in declaration order. Structured owner of the
rulefile= legacy bucket entries.
get_values: Vec<String>--get PATH,FILE values in declaration order. Structured owner of
the get= legacy bucket entries.
unknown_flags: Vec<String>Unknown flags that are not recognized.
strict_violations: Vec<String>Options accepted by the migration translator but not by the frozen pproxy 2.7.9 parser, plus positional arguments and long aliases. Compatibility execution treats these as parser errors.
Implementations§
Source§impl PproxyArgs
impl PproxyArgs
Sourcepub fn test_target(&self) -> Option<&str>
pub fn test_target(&self) -> Option<&str>
Return the target supplied to --test, preserving the parser’s
value-taking semantics for both compatibility execution entry points.
Reads the structured --test field, not the legacy string bucket.
Sourcepub fn recognized_option_names() -> &'static [&'static str]
pub fn recognized_option_names() -> &'static [&'static str]
Authoritative inventory of every option the frozen 2.7.9 parser recognizes, adjacent to the parser itself. The standalone help text and the help/parser drift test consume this metadata so recognized options cannot silently drift away from documented ones.
Sourcepub fn udp_listen_addrs(&self) -> Vec<&str>
pub fn udp_listen_addrs(&self) -> Vec<&str>
Structured presentation state for the startup banner and diagnostics.
These accessors read the typed parser fields. The legacy
known_unsupported string bucket stays populated for back-compat but
must not be scanned by internal code.
Whether each entry blocks startup is decided separately by the execution gate over the translation output, never by these presentation helpers.
UDP listener addresses from -ul, in declaration order.
Sourcepub fn udp_remote_addrs(&self) -> Vec<&str>
pub fn udp_remote_addrs(&self) -> Vec<&str>
UDP upstream values from -ur, in declaration order.
Sourcepub fn tls_requested(&self) -> bool
pub fn tls_requested(&self) -> bool
Whether TLS was requested on listeners via --ssl.
Sourcepub fn pac_requested(&self) -> bool
pub fn pac_requested(&self) -> bool
Whether PAC serving was requested via --pac.
Sourcepub fn scheduler_value(&self) -> Option<&str>
pub fn scheduler_value(&self) -> Option<&str>
Raw -s scheduler value, if given.
Sourcepub fn alive_value(&self) -> Option<&str>
pub fn alive_value(&self) -> Option<&str>
Raw -a alive interval value, if given.
Sourcepub fn default_args() -> Self
pub fn default_args() -> Self
Create default pproxy args equivalent to running pproxy with no arguments.
Real pproxy defaults to a mixed HTTP/SOCKS4/SOCKS5 listener on :8080
with direct routing.
Sourcepub fn parse(raw: &[String]) -> Result<Self, CompatError>
pub fn parse(raw: &[String]) -> Result<Self, CompatError>
Parse from raw argument list (excluding argv[0]).
Sourcepub fn unknown_flag_diagnostics(&self) -> Vec<CompatWarning>
pub fn unknown_flag_diagnostics(&self) -> Vec<CompatWarning>
Identify unrecognized flags and return diagnostics for them.
Sourcepub fn unknown_flag_translation_output(&self) -> TranslationOutput
pub fn unknown_flag_translation_output(&self) -> TranslationOutput
Return a TranslationOutput containing the unknown-flag diagnostics.
Sourcepub fn has_unknown_or_unsupported(&self) -> bool
pub fn has_unknown_or_unsupported(&self) -> bool
Check if there are any unknown or translation-decision flags.
Legacy parser-bucket check: true when unknown flags, the legacy
known_unsupported translation bucket, or --daemon are present.
This is not the execution decision — startup blocking is owned by
crate::gate::evaluate over the translation output.
Sourcepub fn strict_parser_violations(&self) -> Vec<String>
pub fn strict_parser_violations(&self) -> Vec<String>
Return parser violations against the exact 2.7.9 command surface.
Sourcepub fn version_string() -> String
pub fn version_string() -> String
Version string used by all compatibility entry points.
Sourcepub fn validate_strict_values(&self) -> Result<(), CompatError>
pub fn validate_strict_values(&self) -> Result<(), CompatError>
Validate values whose upstream argparse type= callbacks run during
parsing. URI failures therefore stay in the CLI-parse category rather
than being reported as a later runtime/configuration failure.
Reads the structured parser fields, not the legacy string bucket.
Sourcepub fn effective_auth_timeout(&self) -> Duration
pub fn effective_auth_timeout(&self) -> Duration
Return the pproxy default re-authentication interval when --auth was
omitted. The field remains optional so translation/API callers can
distinguish an explicit compatibility option from the parser default.
Sourcepub fn default_log_level(&self) -> &'static str
pub fn default_log_level(&self) -> &'static str
Default tracing log level chosen from -d and -v verbosity flags.
Resolution order (highest precedence first):
-vvv->trace-v/-vv/-d->debug- otherwise ->
info
-d is independent of -v and of --daemon. This helper is the
single source of truth used by the standalone compatibility binary
(and tests) so the observable behavior of -d is testable without
depending on tracing internals.
An explicit RUST_LOG environment variable remains authoritative
at the tracing_subscriber layer; this helper is only consulted when
RUST_LOG is unset or invalid.
Sourcepub fn parse_local_uris(&self) -> Result<Vec<PproxyUri>, CompatError>
pub fn parse_local_uris(&self) -> Result<Vec<PproxyUri>, CompatError>
Parse all local URIs into typed representations.
Sourcepub fn parse_remote_uris(&self) -> Result<Vec<PproxyUri>, CompatError>
pub fn parse_remote_uris(&self) -> Result<Vec<PproxyUri>, CompatError>
Parse all remote URIs into typed representations.
Sourcepub fn parse_remote_chains(&self) -> Result<Vec<PproxyChain>, CompatError>
pub fn parse_remote_chains(&self) -> Result<Vec<PproxyChain>, CompatError>
Parse all remote URIs into chain representations (supports __ separators).
Trait Implementations§
Source§impl Clone for PproxyArgs
impl Clone for PproxyArgs
Source§fn clone(&self) -> PproxyArgs
fn clone(&self) -> PproxyArgs
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more