Skip to content

Commit

Permalink
Merge branch 'master' into win7
Browse files Browse the repository at this point in the history
  • Loading branch information
ssrlive committed Sep 25, 2024
2 parents d353f57 + 371b7f8 commit e77782d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 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.35"
version = "0.2.36"
edition = "2021"
license = "MIT"
description = "A simple proxy tunnel, minimalist tool for bypassing the GFW."
Expand Down
2 changes: 1 addition & 1 deletion readme-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ overtls 客戶端首先與 overtls 服務端建立 TLS 連接,然後 overtls
如果你已經安裝了 [Rust](https://rustup.rs/),你可以直接安裝 overtls。
```bash
cargo install overtls
cargo install overtls --root /usr/local/
```
### 預編譯二進制文件
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ In summary, we need to prepare the following things
If you have installed the [Rust](https://rustup.rs/), you can install overtls directly.
```bash
cargo install overtls
cargo install overtls --root /usr/local/
```
### Pre-compiled binary file
Expand Down
3 changes: 2 additions & 1 deletion src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,9 @@ pub(crate) async fn create_ws_stream<S: AsyncRead + AsyncWrite + Unpin>(
let tunnel_path = config.tunnel_path.extract().first().ok_or(err)?.trim_matches('/');

let b64_dst = dst_addr.as_ref().map(|dst_addr| addess_to_b64str(dst_addr, false));
let host = client.server_domain.as_ref().unwrap_or(&client.server_host);

let uri = format!("ws://{}/{}/", client.server_host, tunnel_path);
let uri = format!("ws://{}/{}/", host, tunnel_path);

let uri = WeirdUri::new(&uri, b64_dst, udp_tunnel, client.client_id.clone());

Expand Down
6 changes: 6 additions & 0 deletions src/weirduri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ fn combine_addr_and_port(addr: &url::Host<&str>, port: Option<u16>) -> String {

impl IntoClientRequest for WeirdUri {
fn into_client_request(self) -> Result<Request> {
self.into_client_request_v1()
}
}

impl WeirdUri {
fn into_client_request_v1(self) -> Result<Request> {
let uri = url::Url::parse(&self.uri).map_err(|_| Error::Url(UrlError::NoPathOrQuery))?;

let host = uri.host().ok_or(Error::from(UrlError::EmptyHostName))?;
Expand Down

0 comments on commit e77782d

Please sign in to comment.