rustdesk-server/src/hbbr.rs

23 lines
703 B
Rust
Raw Normal View History

2020-09-18 17:32:45 +08:00
use clap::App;
2021-03-19 11:50:09 +08:00
mod relay_server;
2021-03-19 16:38:10 +08:00
use hbb_common::{env_logger::*, ResultType};
use relay_server::*;
use std::sync::{Arc, Mutex};
2020-09-18 17:32:45 +08:00
2021-03-19 16:38:10 +08:00
fn main() -> ResultType<()> {
2020-09-18 17:32:45 +08:00
init_from_env(Env::default().filter_or(DEFAULT_FILTER_ENV, "info"));
let args = format!(
"-p, --port=[NUMBER(default={})] 'Sets the listening port'",
DEFAULT_PORT
);
let matches = App::new("hbbr")
2020-09-24 17:26:58 +08:00
.version(hbbs::VERSION)
2020-09-24 17:45:38 +08:00
.author("CarrieZ Studio<info@rustdesk.com>")
2020-09-18 17:32:45 +08:00
.about("RustDesk Relay Server")
.args_from_usage(&args)
.get_matches();
2021-03-19 16:38:10 +08:00
let stop: Arc<Mutex<bool>> = Default::default();
start(matches.value_of("port").unwrap_or(DEFAULT_PORT), stop)?;
2020-09-18 17:32:45 +08:00
Ok(())
}