Skip to content

Commit

Permalink
fix: window test error
Browse files Browse the repository at this point in the history
  • Loading branch information
zzzgydi committed Mar 20, 2024
1 parent add5bbd commit e0f8ba1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,15 @@ impl Sysproxy {
.unwrap_or("".into());
let server = server.as_str();

let socket = SocketAddr::from_str(server).or(Err(Error::ParseStr(server.to_string())))?;
let host = socket.ip().to_string();
let port = socket.port();
let (host, port) = if server.is_empty() {
("".into(), 0)
} else {
let socket =
SocketAddr::from_str(server).or(Err(Error::ParseStr(server.to_string())))?;
let host = socket.ip().to_string();
let port = socket.port();
(host, port)
};

let bypass = cur_var.get_value("ProxyOverride").unwrap_or("".into());

Expand Down

0 comments on commit e0f8ba1

Please sign in to comment.