Skip to content

Commit

Permalink
多级代理
Browse files Browse the repository at this point in the history
  • Loading branch information
tickbh committed Jan 25, 2024
1 parent fb90973 commit a7aa354
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/control/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,11 @@ impl ControlServer {
log::info!("控制端口绑定:{:?},提供中控功能。", value.control);
match TcpListener::bind(value.control).await {
Ok(tcp) =>tcp,
Err(e) => {
Err(_) => {
log::info!("控制端口绑定失败:{},请配置不同端口。",value.control);
return Err(e.into());
let pending = std::future::pending();
let () = pending.await;
return Ok(());
}
}
};
Expand Down
2 changes: 2 additions & 0 deletions src/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ fn default_bind_addr() -> SocketAddr {
pub struct ProxyConfig {
/// 代理id
#[bpaf(
fallback(0),
display_fallback,
short('s'),
long
)]
Expand Down
2 changes: 1 addition & 1 deletion src/wmcore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ impl WMCore {
};
}
Some((inbound, addr)) = Self::tcp_listen_work(&self.client_listener) => {
log::trace!("代理收到客户端连接: {}->{}", addr, self.center_listener.as_ref().unwrap().local_addr()?);
log::trace!("代理收到客户端连接: {}->{}", addr, self.client_listener.as_ref().unwrap().local_addr()?);
let _ = self.deal_client_stream(inbound, addr).await;
}
Some((inbound, addr)) = Self::tcp_listen_work(&self.map_http_listener) => {
Expand Down

0 comments on commit a7aa354

Please sign in to comment.