This commit is contained in:
rustdesk
2021-04-03 22:32:14 +08:00
parent 6a3903df2c
commit a10bb34f6e
5 changed files with 36 additions and 31 deletions

10
mod.rs
View File

@@ -8,12 +8,12 @@ lazy_static::lazy_static! {
static ref STOP: Arc<Mutex<bool>> = Arc::new(Mutex::new(true));
}
pub fn bootstrap(license: &str, host: &str) {
pub fn bootstrap(key: &str, host: &str) {
let port = rendezvous_server::DEFAULT_PORT;
let addr = format!("0.0.0.0:{}", port);
let addr2 = format!("0.0.0.0:{}", port.parse::<i32>().unwrap_or(0) - 1);
let relay_servers: Vec<String> = vec![format!("{}:{}", host, relay_server::DEFAULT_PORT)];
let tmp_license = license.to_owned();
let tmp_key = key.to_owned();
std::thread::spawn(move || {
allow_err!(rendezvous_server::RendezvousServer::start(
&addr,
@@ -22,15 +22,15 @@ pub fn bootstrap(license: &str, host: &str) {
0,
Default::default(),
Default::default(),
&tmp_license,
&tmp_key,
STOP.clone(),
));
});
let tmp_license = license.to_owned();
let tmp_key = key.to_owned();
std::thread::spawn(move || {
allow_err!(relay_server::start(
relay_server::DEFAULT_PORT,
&tmp_license,
&tmp_key,
STOP.clone()
));
});