add relay in --config https://github.com/rustdesk/rustdesk/discussions/7118
This commit is contained in:
parent
2a0c081380
commit
b85526ce54
@ -348,6 +348,7 @@ pub fn core_main() -> Option<Vec<String>> {
|
||||
lic.host,
|
||||
);
|
||||
crate::ui_interface::set_option("api-server".into(), lic.api);
|
||||
crate::ui_interface::set_option("relay-server".into(), lic.relay);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -10,6 +10,8 @@ pub struct License {
|
||||
pub host: String,
|
||||
#[serde(default)]
|
||||
pub api: String,
|
||||
#[serde(default)]
|
||||
pub relay: String,
|
||||
}
|
||||
|
||||
fn get_license_from_string_(s: &str) -> ResultType<License> {
|
||||
@ -56,6 +58,7 @@ pub fn get_license_from_string(s: &str) -> ResultType<License> {
|
||||
let mut host = "";
|
||||
let mut key = "";
|
||||
let mut api = "";
|
||||
let mut relay = "";
|
||||
let strs_iter = strs.iter();
|
||||
for el in strs_iter {
|
||||
if el.starts_with("host=") {
|
||||
@ -67,11 +70,15 @@ pub fn get_license_from_string(s: &str) -> ResultType<License> {
|
||||
if el.starts_with("api=") {
|
||||
api = &el[4..el.len()];
|
||||
}
|
||||
if el.starts_with("relay=") {
|
||||
relay = &el[4..el.len()];
|
||||
}
|
||||
}
|
||||
return Ok(License {
|
||||
host: host.to_owned(),
|
||||
key: key.to_owned(),
|
||||
api: api.to_owned(),
|
||||
relay: relay.to_owned(),
|
||||
});
|
||||
} else {
|
||||
let strs = if s.contains("-licensed-") {
|
||||
|
Loading…
x
Reference in New Issue
Block a user