summaryrefslogtreecommitdiffhomepage
path: root/mullvad-paths/src/rpc_socket.rs
blob: 80eb4360d2599a222650e190b507686463576f7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::path::PathBuf;

pub fn get_rpc_socket_path() -> PathBuf {
    match std::env::var_os("MULLVAD_RPC_SOCKET_PATH") {
        Some(path) => PathBuf::from(path),
        None => get_default_rpc_socket_path(),
    }
}

#[cfg(any(target_os = "linux", target_os = "macos"))]
pub fn get_default_rpc_socket_path() -> PathBuf {
    PathBuf::from("/var/run/mullvad-vpn")
}

#[cfg(windows)]
pub fn get_default_rpc_socket_path() -> PathBuf {
    PathBuf::from("//./pipe/Mullvad VPN")
}