mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-12-04 20:21:35 +08:00
secure request_relay https://github.com/rustdesk/rustdesk/pull/4800
This commit is contained in:
parent
15a8b66140
commit
907a62a586
@ -593,12 +593,18 @@ impl Client {
|
||||
let mut succeed = false;
|
||||
let mut uuid = "".to_owned();
|
||||
let mut ipv4 = true;
|
||||
|
||||
for i in 1..=3 {
|
||||
// use different socket due to current hbbs implement requiring different nat address for each attempt
|
||||
// use different socket due to current hbbs implementation requiring different nat address for each attempt
|
||||
let mut socket = socket_client::connect_tcp(rendezvous_server, CONNECT_TIMEOUT)
|
||||
.await
|
||||
.with_context(|| "Failed to connect to rendezvous server")?;
|
||||
|
||||
if !key.is_empty() && !token.is_empty() {
|
||||
// mainly for the security of token
|
||||
allow_err!(secure_punch_connection(&mut socket, key).await);
|
||||
}
|
||||
|
||||
ipv4 = socket.local_addr().is_ipv4();
|
||||
let mut msg_out = RendezvousMessage::new();
|
||||
uuid = Uuid::new_v4().to_string();
|
||||
|
Loading…
Reference in New Issue
Block a user