Skip to main content

Crate ptrs_gesher

Crate ptrs_gesher 

Source
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 (feature obfs4, default) — obfs4 transport.
  • webtunnel (feature webtunnel, default) — TLS + HTTP/1.1 Upgrade transport.
  • bridge_line (feature bridge-line, default) — torrc Bridge directive parser.
  • lyrebird (feature lyrebird, 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.
BridgeLine
A parsed Tor bridge line.
WebTunnelBuilder
Builder for the WebTunnel client transport.
WebTunnelClient
A WebTunnel client that has been configured and is ready to connect.
WebTunnelConfig
Parameters extracted from a webtunnel bridge line’s key=value args.

Enums§

BridgeLineParseError
Errors produced when parsing a bridge line.
PtrsError
Errors that can occur during Pluggable Transport establishment.

Constants§

WEBTUNNEL_NAME
Transport name constant.

Traits§

ClientBuilder
Client Transport Builder
ClientTransport
Client Transport
PluggableTransport
Core trait for a pluggable transport, defining its builder types.
ServerBuilder
Server Transport builder interface
ServerTransport
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.

Type Aliases§

Obfs4PT
Concrete obfs4 pluggable transport bound to TcpStream.