Skip to content

Commit

Permalink
Bump version 0.2.18
Browse files Browse the repository at this point in the history
  • Loading branch information
ssrlive committed Mar 28, 2024
1 parent b227e63 commit dc0701d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "overtls"
version = "0.2.17"
version = "0.2.18"
edition = "2021"
license = "MIT"
description = "A simple proxy tunnel, minimalist tool for bypassing the GFW."
Expand Down
22 changes: 16 additions & 6 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,19 +280,29 @@ impl Config {
}
}
if let Some(client) = &mut self.client {
let server_host = client.server_host.clone();
let server_host = match (server_host.is_empty(), client.server_domain.clone()) {
(true, Some(domain)) => match domain.is_empty() {
true => return Err(Error::from("We need server host in client settings")),
false => domain,
},
(true, None) => return Err(Error::from("We need server host in client settings")),
(false, _) => server_host,
};
if client.server_host.is_empty() {
return Err(Error::from("We need server host in client settings"));
client.server_host = server_host.clone();
}
if client.server_domain.is_none() || client.server_domain.as_ref().unwrap_or(&"".to_string()).is_empty() {
client.server_domain = Some(server_host.clone());
}

if client.server_port == 0 {
client.server_port = 443;
}
if client.server_domain.is_none() || client.server_domain.as_ref().unwrap_or(&"".to_string()).is_empty() {
client.server_domain = Some(client.server_host.clone());
}

if !self.is_server {
let mut addr = (client.server_host.clone(), client.server_port).to_socket_addrs()?;
let addr = addr.next().ok_or("address not exist")?;
let mut addr = (server_host, client.server_port).to_socket_addrs()?;
let addr = addr.next().ok_or("address not available")?;
#[cfg(not(target_os = "android"))]
{
let timeout = std::time::Duration::from_secs(self.test_timeout_secs);
Expand Down

0 comments on commit dc0701d

Please sign in to comment.