Expand description
§ptrs-gesher
Umbrella crate for the ptrs-gesher framework for Rust pluggable transports. Re-exports a flat top-level API plus the per-crate modules for deeper access.
§Examples
use ptrs_gesher::{Args, BridgeLine};
// Parse a torrc bridge line:
let bridge: BridgeLine = "192.0.2.1:443 ABCDEF0123456789ABCDEF0123456789ABCDEF01"
.parse()
.unwrap();
assert_eq!(bridge.addr.port(), 443);
// Build a PT argument bag:
let mut args = Args::new();
args.add("cert", "AAA");
assert_eq!(args.retrieve("cert").as_deref(), Some("AAA"));§Components
ptrs— core traits and helpers (ClientBuilder,ClientTransport,PluggableTransport,Args, …).obfs4(featureobfs4, default) — obfs4 transport.webtunnel(featurewebtunnel, default) — TLS + HTTP/1.1 Upgrade transport.bridge_line(featurebridge-line, default) — torrcBridgedirective parser.lyrebird(featurelyrebird, off by default) — PT-manager loop usable as a library or busybox-style binary.
§Provenance
Forked from jmwample/ptrs
(MIT/Apache 2.0), developed independently. See NOTICE.
Re-exports§
pub use ptrs;pub use obfs4;pub use webtunnel;pub use bridge_line;pub use lyrebird;
Modules§
- args
- Key–value mappings for the representation of client and server options.
Structs§
- Args
- Arguments maintained as a map of string keys to a list of values. It is similar to url.Values.
- Bridge
Line - A parsed Tor bridge line.
- WebTunnel
Builder - Builder for the WebTunnel client transport.
- WebTunnel
Client - A WebTunnel client that has been configured and is ready to connect.
- WebTunnel
Config - Parameters extracted from a webtunnel bridge line’s key=value args.
Enums§
- Bridge
Line Parse Error - Errors produced when parsing a bridge line.
- Ptrs
Error - Errors that can occur during Pluggable Transport establishment.
Constants§
- WEBTUNNEL_
NAME - Transport name constant.
Traits§
- Client
Builder - Client Transport Builder
- Client
Transport - Client Transport
- Pluggable
Transport - Core trait for a pluggable transport, defining its builder types.
- Server
Builder - Server Transport builder interface
- Server
Transport - Server Transport
Functions§
- arg_
string_ from_ creds - Reconstruct the PT-spec argument string from the SOCKS5
USERNAME/PASSWORD fields, mirroring Go lyrebird
rfc1929.go:88-100. - resolve_
target_ addr - Parse an IP-literal target without performing DNS resolution. Hostnames are rejected: resolving bridge targets is the Tor client’s responsibility.