mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-11-19 06:26:14 -05:00
Refactor using Tauri (#278)
This commit is contained in:
1 parent
edc13ed14d
commit
04a916a3e1
199 files changed
+10153
-7203
No files matched your search
@@ -0,0 +1,20 @@
|
||||
use tokio::fs;
|
||||
|
||||
use crate::GP_SERVICE_LOCK_FILE;
|
||||
|
||||
async fn read_port() -> anyhow::Result<String> {
|
||||
let port = fs::read_to_string(GP_SERVICE_LOCK_FILE).await?;
|
||||
Ok(port.trim().to_string())
|
||||
}
|
||||
|
||||
pub async fn http_endpoint() -> anyhow::Result<String> {
|
||||
let port = read_port().await?;
|
||||
|
||||
Ok(format!("http://127.0.0.1:{}", port))
|
||||
}
|
||||
|
||||
pub async fn ws_endpoint() -> anyhow::Result<String> {
|
||||
let port = read_port().await?;
|
||||
|
||||
Ok(format!("ws://127.0.0.1:{}/ws", port))
|
||||
}
|
||||
Reference in new issue
Block a user