Skip to content

Commit

Permalink
chore: Update base64 dependency to version 0.22.1
Browse files Browse the repository at this point in the history
  • Loading branch information
arloor committed Sep 4, 2024
1 parent 64c6a11 commit c8066fd
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch_example.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"--local-addr",
"0.0.0.0:2080",
"-k",
"base64_password",
"username:password",
"-v",
"-m",
"aes-256-gcm", // reversed for compatibility
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions crates/shadowsocks-service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ https-tunnel = [
"webpki-roots",
"rustls-native-certs",
"httparse",
"base64",
]
# Enable REDIR protocol for sslocal
# (transparent proxy)
Expand Down Expand Up @@ -169,6 +170,7 @@ tokio-rustls = { version = "0.26", optional = true, default-features = false, fe
"tls12",
"ring",
] }
base64 = { version = "0.22", optional = true }
rustls-native-certs = { version = "0.7", optional = true }
async-trait = "0.1"
rustls = { version = "0", default-features = false, features = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,12 @@ impl AutoProxyClientStream {
}
};
let tls_stream = connector.connect(host.to_owned(), stream).await?;

use base64::Engine;
let base64 = base64::engine::general_purpose::STANDARD.encode(server.server_config().password());
Ok(AutoProxyClientStream::HttpTunnel(HttpTunnelStream {
stream: tls_stream,
addr: addr.into(),
auth: "Basic ".to_owned() + server.server_config().password(),
auth: "Basic ".to_owned() + base64.as_str(),
}))
}

Expand Down
7 changes: 2 additions & 5 deletions test.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
```
cargo run --package shadowsocks-rust --bin sslocal -- --local-addr 0.0.0.0:2080 -k xxxxxx -v -m aes-256-gcm -s us.arloor.dev:444 --protocol http --use-http-tunnel=true
```

```bash
cargo install --path . --bin sslocal
sslocal --local-addr 0.0.0.0:2080 -k xxxxxx -v -m aes-256-gcm -s us.arloor.dev:444 --use-http-tunnel=true
cargo install --path . --bin sslocal --features https-tunnel
sslocal --local-addr 0.0.0.0:2080 -k username:password -v -m aes-256-gcm -s us.arloor.dev:444
curl https://baidu.com -x http://localhost:2080
```

0 comments on commit c8066fd

Please sign in to comment.