File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ use std::sync::Arc;
3232use std:: time:: Duration ;
3333use std:: { fmt, io} ;
3434use tokio:: io:: { AsyncRead , AsyncWrite } ;
35- use tokio:: net:: { TcpStream , UdpSocket } ;
35+ use tokio:: net:: TcpStream ;
3636use tokio:: select;
3737
3838use tokio_rustls:: rustls:: pki_types:: { CertificateDer , DnsName , PrivateKeyDer , ServerName } ;
@@ -777,13 +777,6 @@ impl WsClientConfig {
777777#[ tokio:: main]
778778async fn main ( ) {
779779 let args = Wstunnel :: parse ( ) ;
780- let socket = UdpSocket :: bind ( SocketAddrV6 :: new ( Ipv6Addr :: UNSPECIFIED , 0 , 0 , 0 ) )
781- . await
782- . unwrap ( ) ;
783- socket
784- . connect ( "[2001:4810:0:3::78]:443" . parse :: < SocketAddr > ( ) . unwrap ( ) )
785- . await
786- . unwrap ( ) ;
787780
788781 // Setup logging
789782 let mut env_filter = EnvFilter :: builder ( ) . parse ( & args. log_lvl ) . expect ( "Invalid log level" ) ;
Original file line number Diff line number Diff line change @@ -75,8 +75,15 @@ pub async fn connect(
7575
7676 for ( ix, addr) in socket_addrs. into_iter ( ) . enumerate ( ) {
7777 let socket = match & addr {
78- SocketAddr :: V4 ( _) => TcpSocket :: new_v4 ( ) ?,
79- SocketAddr :: V6 ( _) => TcpSocket :: new_v6 ( ) ?,
78+ SocketAddr :: V4 ( _) => TcpSocket :: new_v4 ( ) ,
79+ SocketAddr :: V6 ( _) => TcpSocket :: new_v6 ( ) ,
80+ } ;
81+ let socket = match socket {
82+ Ok ( s) => s,
83+ Err ( err) => {
84+ last_err = Some ( err) ;
85+ continue ;
86+ }
8087 } ;
8188 configure_socket ( socket2:: SockRef :: from ( & socket) , & so_mark) ?;
8289
You can’t perform that action at this time.
0 commit comments