@@ -47,36 +47,35 @@ pub type NoiseSession<E, D, S> = NetProtocol<NoiseState<E, D>, S>;
47
47
pub type Socks5Session < S > = NetProtocol < socks5:: Socks5 , S > ;
48
48
49
49
#[ cfg( feature = "eidolon" ) ]
50
- pub type CypherSession < I , D , T = TcpStream > =
50
+ pub type CypherSession < I , D , T > =
51
51
EidolonSession < I , NoiseSession < x25519:: PrivateKey , D , Socks5Session < T > > > ;
52
52
53
53
#[ cfg( feature = "eidolon" ) ]
54
54
pub type EidolonReader < S > = NetReader < S > ;
55
55
#[ cfg( feature = "eidolon" ) ]
56
56
pub type EidolonWriter < I , S > = NetWriter < EidolonRuntime < I > , S > ;
57
57
#[ cfg( feature = "eidolon" ) ]
58
- pub type CypherReader < D , T = TcpStream > =
59
- EidolonReader < NoiseSession < x25519:: PrivateKey , D , Socks5Session < T > > > ;
58
+ pub type CypherReader < D , T > = EidolonReader < NoiseSession < x25519:: PrivateKey , D , Socks5Session < T > > > ;
60
59
#[ cfg( feature = "eidolon" ) ]
61
- pub type CypherWriter < I , D , T = TcpStream > =
60
+ pub type CypherWriter < I , D , T > =
62
61
EidolonWriter < I , NoiseSession < x25519:: PrivateKey , D , Socks5Session < T > > > ;
63
62
64
63
#[ cfg( feature = "eidolon" ) ]
65
- impl < I : EcSign , D : Digest > CypherSession < I , D > {
64
+ impl < I : EcSign , D : Digest , T : NetSession > CypherSession < I , D , T > {
66
65
#[ cfg( feature = "reactor" ) ]
67
66
pub fn connect_nonblocking < const HASHLEN : usize > (
68
67
remote_addr : NetAddr < HostName > ,
69
68
cert : Cert < I :: Sig > ,
70
69
allowed_ids : Vec < I :: Pk > ,
71
70
signer : I ,
72
- proxy_addr : NetAddr < InetHost > ,
71
+ proxy_addr : < T :: Connection as NetConnection > :: Addr ,
73
72
force_proxy : bool ,
74
73
timeout : Duration ,
75
74
) -> io:: Result < Self > {
76
75
let connection = if force_proxy {
77
- TcpStream :: connect_nonblocking ( proxy_addr, timeout) ?
76
+ T :: Connection :: connect_nonblocking ( proxy_addr, timeout) ?
78
77
} else {
79
- TcpStream :: connect_nonblocking ( remote_addr. connection_addr ( proxy_addr) , timeout) ?
78
+ T :: Connection :: connect_nonblocking ( remote_addr. connection_addr ( proxy_addr) , timeout) ?
80
79
} ;
81
80
Ok ( Self :: with_config :: < HASHLEN > (
82
81
remote_addr,
@@ -164,7 +163,7 @@ impl<I: EcSign, D: Digest> CypherSession<I, D> {
164
163
165
164
fn with_config < const HASHLEN : usize > (
166
165
remote_addr : NetAddr < HostName > ,
167
- connection : TcpStream ,
166
+ connection : T ,
168
167
direction : Direction ,
169
168
cert : Cert < I :: Sig > ,
170
169
allowed_ids : Vec < I :: Pk > ,
0 commit comments