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 succeed = false;
|
||||||
let mut uuid = "".to_owned();
|
let mut uuid = "".to_owned();
|
||||||
let mut ipv4 = true;
|
let mut ipv4 = true;
|
||||||
|
|
||||||
for i in 1..=3 {
|
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)
|
let mut socket = socket_client::connect_tcp(rendezvous_server, CONNECT_TIMEOUT)
|
||||||
.await
|
.await
|
||||||
.with_context(|| "Failed to connect to rendezvous server")?;
|
.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();
|
ipv4 = socket.local_addr().is_ipv4();
|
||||||
let mut msg_out = RendezvousMessage::new();
|
let mut msg_out = RendezvousMessage::new();
|
||||||
uuid = Uuid::new_v4().to_string();
|
uuid = Uuid::new_v4().to_string();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user