mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-11-19 14:36:15 -05:00
2 files changed
+5
-11
No files matched your search
@@ -122,7 +122,7 @@ impl Cli {
|
|||||||
let browser = self
|
let browser = self
|
||||||
.browser
|
.browser
|
||||||
.as_deref()
|
.as_deref()
|
||||||
.or_else(|| self.default_browser.then_some("default"));
|
.or_else(|| self.default_browser.then(|| "default"));
|
||||||
|
|
||||||
#[cfg(not(feature = "webview-auth"))]
|
#[cfg(not(feature = "webview-auth"))]
|
||||||
let browser = self.browser.as_deref().or(Some("default"));
|
let browser = self.browser.as_deref().or(Some("default"));
|
||||||
|
|||||||
@@ -36,13 +36,7 @@ pub struct Vpn {
|
|||||||
|
|
||||||
impl Vpn {
|
impl Vpn {
|
||||||
pub fn builder(server: &str, cookie: &str) -> VpnBuilder {
|
pub fn builder(server: &str, cookie: &str) -> VpnBuilder {
|
||||||
// prepend "https://" to the server if it doesn't already start with it
|
VpnBuilder::new(server, cookie)
|
||||||
let server = if server.starts_with("https://") {
|
|
||||||
server.to_string()
|
|
||||||
} else {
|
|
||||||
format!("https://{}", server)
|
|
||||||
};
|
|
||||||
VpnBuilder::new(server, cookie.to_string())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn connect(&self, on_connected: impl FnOnce() + 'static + Send + Sync) -> i32 {
|
pub fn connect(&self, on_connected: impl FnOnce() + 'static + Send + Sync) -> i32 {
|
||||||
@@ -140,10 +134,10 @@ pub struct VpnBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl VpnBuilder {
|
impl VpnBuilder {
|
||||||
fn new(server: String, cookie: String) -> Self {
|
fn new(server: &str, cookie: &str) -> Self {
|
||||||
Self {
|
Self {
|
||||||
server,
|
server: server.to_string(),
|
||||||
cookie,
|
cookie: cookie.to_string(),
|
||||||
script: None,
|
script: None,
|
||||||
interface: None,
|
interface: None,
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user