Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
ibigbug committed Sep 30, 2024
1 parent d70b46e commit 05d6677
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
18 changes: 16 additions & 2 deletions clash_lib/src/app/inbound/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::{
dispatcher::Dispatcher,
inbound::network_listener::{ListenerType, NetworkInboundListener},
},
common::auth::ThreadSafeAuthenticator,
common::{auth::ThreadSafeAuthenticator, errors::new_io_error},
config::internal::config::{BindAddress, Inbound},
Error, Runner,
};
Expand Down Expand Up @@ -68,7 +68,21 @@ impl InboundManager {
}

Ok(Box::pin(async move {
futures::future::select_all(runners).await.0
let mut errors = Vec::new();
let _ = futures::future::join_all(runners)
.await
.into_iter()
.filter_map(|r| r.map_err(|e| errors.push(e)).ok())
.collect::<Vec<_>>();
if errors.is_empty() {
Ok(())
} else {
Err(new_io_error(format!(
"failed to start inbound listeners: {:?}",
errors
))
.into())
}
}))
}

Expand Down
5 changes: 2 additions & 3 deletions clash_lib/src/proxy/tproxy/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,8 @@ impl InboundListener for Listener {

#[cfg(not(target_os = "linux"))]
async fn listen_tcp(&self) -> std::io::Result<()> {
use crate::common::errors::new_io_error;

Err(new_io_error("transparent proxy only support linux"))
warn!("tproxy not supported on non Linux");
Ok(())
}

async fn listen_udp(&self) -> std::io::Result<()> {
Expand Down

0 comments on commit 05d6677

Please sign in to comment.