Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions crates/lyrebird/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ fn resolve_target_addr(addr: &TargetAddr) -> Result<SocketAddr> {
TargetAddr::Ip(sa) => Ok(*sa),
TargetAddr::Domain(_, _) => {
// this will always fail because ptrs does not do dns lookups.
ptrs::resolve_addr(format!("{addr}")).context("domain resolution failed")
ptrs::tor::resolve_addr(format!("{addr}")).context("domain resolution failed")
}
}
}
Expand All @@ -189,7 +189,7 @@ async fn main() -> Result<()> {
let args = Args::parse();

// Make state directory
let statedir = ptrs::make_state_dir()?;
let statedir = ptrs::tor::make_state_dir()?;

// launch tracing subscriber with filter level
init_logging_recvr(
Expand All @@ -202,7 +202,7 @@ async fn main() -> Result<()> {
let cancel_token = tokio_util::sync::CancellationToken::new();

// launch runners
let mut exit_rx = if ptrs::is_client()? {
let mut exit_rx = if ptrs::tor::is_client()? {
// running as CLIENT
client_setup(&statedir, cancel_token.clone()).await?
} else {
Expand Down Expand Up @@ -256,7 +256,7 @@ async fn client_setup(
cancel_token: CancellationToken,
) -> Result<oneshot::Receiver<bool>> {
let obfs4_name = Obfs4PT::name();
let client_pt_info = ptrs::ClientInfo::new()?;
let client_pt_info = ptrs::tor::ClientInfo::new()?;
let proxy_uri = client_pt_info.uri.ok_or(BridgeLineParseError)?;
let (tx, rx) = oneshot::channel::<bool>();

Expand Down Expand Up @@ -514,7 +514,7 @@ async fn server_setup(
) -> Result<oneshot::Receiver<bool>> {
let obfs4_name = Obfs4PT::name();

let server_info = ptrs::ServerInfo::new()?;
let server_info = ptrs::tor::ServerInfo::new()?;
let (tx, rx) = oneshot::channel::<bool>();

let mut listeners = Vec::new();
Expand Down
4 changes: 3 additions & 1 deletion crates/ptrs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ repository = "https://github.com/jmwample/ptrs"


[features]
default = []
default = ["tor", "water"]
debug = []
tor = []
water = []

[lib]
name = "ptrs"
Expand Down
12 changes: 7 additions & 5 deletions crates/ptrs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ use tokio::io::{AsyncRead, AsyncWrite};

mod error;
pub use error::Error;
#[macro_use]
pub mod args;
mod helpers;
pub use helpers::*;
mod log;
pub mod orport;

#[cfg(feature = "tor")]
pub mod tor;
pub use tor::args;

#[cfg(feature = "water")]
pub mod water;

pub trait PluggableTransport<InRW>
where
Expand Down
8 changes: 8 additions & 0 deletions crates/ptrs/src/tor.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//! Tor Pluggable Transport integration tools

#[macro_use]
pub mod args;
mod helpers;
pub use helpers::*;

pub mod orport;
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions crates/ptrs/src/water.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/// This trait allows for conversion to a format that can be compiled into a WATER binary.
pub trait Soluble {}

// impl<I> Soluble for Box<dyn ClientBuilder<I>> {}