Expand description
Launching pluggable transport binaries and communicating with them.
This module contains utilities to launch pluggable transports supporting pt-spec.txt version 1, and communicate with them in order to specify configuration parameters and receive updates as to the current state of the PT.
Re-exportsยง
use crate::PtClientMethod;๐use crate::err;๐use crate::err::PtError;๐use futures::StreamExt;๐use futures::channel::mpsc::Receiver;๐use itertools::Itertools;๐use std::borrow::Cow;๐use std::collections::HashMap;๐use std::ffi::OsString;๐use std::io::BufRead;๐use std::io::BufReader;๐use std::net::Ipv4Addr;๐use std::net::Ipv6Addr;๐use std::net::SocketAddr;๐use std::path::PathBuf;๐use std::process::Child;๐use std::process::Command;๐use std::process::Stdio;๐use std::str::FromStr;๐use std::sync::Arc;๐use std::io;๐use std::thread;๐use tor_basic_utils::PathExt as _;๐use tor_error::internal;๐use tor_error::warn_report;๐use tor_linkspec::PtTransportName;๐use tor_rtcompat::Runtime;๐use tor_rtcompat::SleepProviderExt;๐use tor_socksproto::SocksVersion;๐use tracing::debug;๐use tracing::error;๐use tracing::info;๐use tracing::trace;๐use tracing::warn;๐use web_time_compat::Duration;๐use web_time_compat::Instant;๐use web_time_compat::InstantExt;๐use sealed::*;๐
Modulesยง
- sealed ๐
- Sealed trait to protect private types and default trait implementations
Structsยง
- Pluggable
Client Transport - A pluggable transport binary in a child process.
- Pluggable
Server Transport - A pluggable transport server binary in a child process.
- PtClient
Parameters - Parameters passed only to a pluggable transport client.
- PtClient
Parameters Builder - Builder for
PtClientParameters. - PtCommon
Parameters - Common parameters passed to a pluggable transport.
- PtCommon
Parameters Builder - Builder for
PtCommonParameters. - PtServer
Parameters - Parameters passed only to a pluggable transport server.
- PtServer
Parameters Builder - Builder for
PtServerParameters. - PtStatus
- An arbitrary key/value status update from a pluggable transport.
Enumsยง
- PtClient
Parameters Builder Error - Error type for PtClientParametersBuilder
- PtCommon
Parameters Builder Error - Error type for PtCommonParametersBuilder
- PtMessage
- A message sent from a pluggable transport child process.
- PtServer
Parameters Builder Error - Error type for PtServerParametersBuilder
Constantsยง
- GRACEFUL_
EXIT_ ๐TIME - Amount of time we give a pluggable transport child process to exit gracefully.
- PT_
START_ ๐TIMEOUT - Default timeout for PT binary startup.
- PT_
STDIO_ ๐BUFFER - Size for the buffer storing pluggable transport stdout lines.
Traitsยง
- Pluggable
Transport - Common functionality implemented to allow code reuse
Functionsยง
- parse_
one_ ๐smethod_ arg - Chomp one key/value pair off a list of smethod args. Returns (k, v, unparsed rest of string). Will also chomp the comma at the end, if there is one.
- parse_
one_ ๐value - Parse a value (something on the RHS of an =), which could be a CString as defined by control-spec.txt ยง2. Returns (value, unparsed rest of string).