1
+ #[ cfg( not( target_os = "windows" ) ) ]
2
+ use std:: path:: Path ;
1
3
#[ cfg( feature = "hyper" ) ]
2
4
use std:: {
3
5
convert:: Infallible ,
@@ -6,7 +8,6 @@ use std::{
6
8
use std:: {
7
9
io,
8
10
net:: SocketAddr ,
9
- path:: Path ,
10
11
} ;
11
12
12
13
use async_trait:: async_trait;
@@ -19,6 +20,8 @@ use hyper::{
19
20
Response ,
20
21
StatusCode ,
21
22
} ;
23
+ #[ cfg( not( target_os = "windows" ) ) ]
24
+ use tokio:: net:: UnixStream ;
22
25
use tokio:: {
23
26
io:: {
24
27
AsyncRead ,
@@ -29,7 +32,6 @@ use tokio::{
29
32
net:: {
30
33
TcpStream ,
31
34
ToSocketAddrs ,
32
- UnixStream ,
33
35
} ,
34
36
task:: JoinHandle ,
35
37
} ;
@@ -69,6 +71,7 @@ pub trait TunnelExt: Tunnel {
69
71
}
70
72
71
73
/// Forward incoming tunnel connections to the provided Unix socket path.
74
+ #[ cfg( not( target_os = "windows" ) ) ]
72
75
#[ instrument( level = "debug" , skip_all, fields( path) ) ]
73
76
async fn forward_unix ( & mut self , addr : String ) -> Result < ( ) , io:: Error > {
74
77
forward_unix_conns ( self , addr, |_, _| { } ) . await
95
98
Ok ( ( ) )
96
99
}
97
100
101
+ #[ cfg( not( target_os = "windows" ) ) ]
98
102
async fn forward_unix_conns < T , F > (
99
103
this : & mut T ,
100
104
addr : String ,
@@ -193,6 +197,7 @@ where
193
197
Ok ( true )
194
198
}
195
199
200
+ #[ cfg( not( target_os = "windows" ) ) ]
196
201
#[ instrument( level = "debug" , skip_all, fields( remote_addr, local_addr) ) ]
197
202
async fn handle_one_unix < T , F > ( this : & mut T , addr : & Path , on_error : F ) -> Result < bool , io:: Error >
198
203
where
0 commit comments