mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 06:33:45 +08:00
fix: windows build error
This commit is contained in:
parent
2a908b20eb
commit
3488d89b7d
@ -1,8 +1,12 @@
|
|||||||
use crate::{config::Config, utils::dirs::app_socket_path};
|
use crate::config::Config;
|
||||||
|
#[cfg(unix)]
|
||||||
|
use crate::utils::dirs::app_socket_path;
|
||||||
use mihomo_api;
|
use mihomo_api;
|
||||||
use once_cell::sync::{Lazy, OnceCell};
|
use once_cell::sync::{Lazy, OnceCell};
|
||||||
use std::sync::Mutex;
|
use std::sync::Mutex;
|
||||||
use tauri::http::{HeaderMap, HeaderValue};
|
use tauri::http::HeaderMap;
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
|
use tauri::http::HeaderValue;
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
use tokio_tungstenite::tungstenite::http;
|
use tokio_tungstenite::tungstenite::http;
|
||||||
|
|
||||||
@ -70,7 +74,7 @@ impl MihomoManager {
|
|||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
let socket_path = app_socket_path().unwrap();
|
let socket_path = app_socket_path().unwrap();
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
let socket_path = r"\\.\pipe\mihomo";
|
let socket_path = r"\\.\pipe\mihomo".to_string();
|
||||||
socket_path
|
socket_path
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,23 +1,18 @@
|
|||||||
use crate::{model::E, sock};
|
use crate::model::E;
|
||||||
use hyper::Method;
|
use hyper::Method;
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
use tokio_util::codec::{Framed, LinesCodec};
|
use tokio_util::codec::{Framed, LinesCodec};
|
||||||
use std::{sync::Arc, time::Duration};
|
use std::time::Duration;
|
||||||
use tokio::{
|
use tokio::time::timeout;
|
||||||
time::timeout,
|
|
||||||
sync::Mutex,
|
|
||||||
};
|
|
||||||
use futures::{SinkExt, StreamExt};
|
use futures::{SinkExt, StreamExt};
|
||||||
use tokio::net::windows::named_pipe::ClientOptions;
|
use tokio::net::windows::named_pipe::ClientOptions;
|
||||||
|
|
||||||
pub struct WindowsClient {
|
pub struct WindowsClient {
|
||||||
lock: Arc<Mutex<()>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl WindowsClient {
|
impl WindowsClient {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Self {
|
Self {
|
||||||
lock: Arc::new(Mutex::new(())),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user