mirror of
https://github.com/erebe/wstunnel.git
synced 2025-09-26 19:21:10 +08:00
lint
Some checks failed
/ Build - Windows x86 (push) Has been cancelled
/ Build - Windows x86_64 (push) Has been cancelled
/ Build - Linux x86 (push) Has been cancelled
/ Build - Android aarch64 (push) Has been cancelled
/ Build - Linux aarch64 (push) Has been cancelled
/ Build - Linux x86_64 (push) Has been cancelled
/ Build - MacOS aarch64 (push) Has been cancelled
/ Build - MacOS x86_64 (push) Has been cancelled
/ Build - Freebsd x86_64 (push) Has been cancelled
/ Build - Android armv7 (push) Has been cancelled
/ Build - Freebsd x86 (push) Has been cancelled
/ Build - Linux armv6 (push) Has been cancelled
/ Build - Linux armv7hf (push) Has been cancelled
/ Release (push) Has been cancelled
Some checks failed
/ Build - Windows x86 (push) Has been cancelled
/ Build - Windows x86_64 (push) Has been cancelled
/ Build - Linux x86 (push) Has been cancelled
/ Build - Android aarch64 (push) Has been cancelled
/ Build - Linux aarch64 (push) Has been cancelled
/ Build - Linux x86_64 (push) Has been cancelled
/ Build - MacOS aarch64 (push) Has been cancelled
/ Build - MacOS x86_64 (push) Has been cancelled
/ Build - Freebsd x86_64 (push) Has been cancelled
/ Build - Android armv7 (push) Has been cancelled
/ Build - Freebsd x86 (push) Has been cancelled
/ Build - Linux armv6 (push) Has been cancelled
/ Build - Linux armv7hf (push) Has been cancelled
/ Release (push) Has been cancelled
This commit is contained in:
139
Cargo.lock
generated
139
Cargo.lock
generated
@@ -186,9 +186,9 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
|
||||
|
||||
[[package]]
|
||||
name = "autocfg"
|
||||
version = "1.4.0"
|
||||
version = "1.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
|
||||
checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
|
||||
|
||||
[[package]]
|
||||
name = "aws-lc-fips-sys"
|
||||
@@ -363,9 +363,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "bumpalo"
|
||||
version = "3.18.1"
|
||||
version = "3.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "793db76d6187cd04dff33004d8e6c9cc4e05cd330500379d2394209271b4aeee"
|
||||
checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43"
|
||||
|
||||
[[package]]
|
||||
name = "bytes"
|
||||
@@ -756,6 +756,12 @@ version = "1.0.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813"
|
||||
|
||||
[[package]]
|
||||
name = "dyn-clone"
|
||||
version = "1.0.19"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1c7a8fb8a9fbf66c1f703fe16184d10ca0ee9d23be5b4436400408ba54a95005"
|
||||
|
||||
[[package]]
|
||||
name = "either"
|
||||
version = "1.15.0"
|
||||
@@ -782,12 +788,12 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
|
||||
|
||||
[[package]]
|
||||
name = "errno"
|
||||
version = "0.3.12"
|
||||
version = "0.3.13"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cea14ef9355e3beab063703aa9dab15afd25f0667c341310c1e5274bb1d0da18"
|
||||
checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"windows-sys 0.59.0",
|
||||
"windows-sys 0.60.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1104,7 +1110,7 @@ dependencies = [
|
||||
"futures-core",
|
||||
"futures-sink",
|
||||
"http",
|
||||
"indexmap 2.9.0",
|
||||
"indexmap 2.10.0",
|
||||
"slab",
|
||||
"tokio",
|
||||
"tokio-util",
|
||||
@@ -1482,9 +1488,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "indexmap"
|
||||
version = "2.9.0"
|
||||
version = "2.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e"
|
||||
checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661"
|
||||
dependencies = [
|
||||
"equivalent",
|
||||
"hashbrown 0.15.4",
|
||||
@@ -1642,9 +1648,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.173"
|
||||
version = "0.2.174"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d8cfeafaffdbc32176b64fb251369d52ea9f0a8fbc6f8759edffef7b525d64bb"
|
||||
checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776"
|
||||
|
||||
[[package]]
|
||||
name = "libloading"
|
||||
@@ -1658,9 +1664,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "libredox"
|
||||
version = "0.1.3"
|
||||
version = "0.1.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d"
|
||||
checksum = "1580801010e535496706ba011c15f8532df6b42297d2e471fec38ceadd8c0638"
|
||||
dependencies = [
|
||||
"bitflags 2.9.1",
|
||||
"libc",
|
||||
@@ -2070,9 +2076,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "prettyplease"
|
||||
version = "0.2.34"
|
||||
version = "0.2.35"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6837b9e10d61f45f987d50808f83d1ee3d206c66acf650c3e4ae2e1f6ddedf55"
|
||||
checksum = "061c1221631e079b26479d25bbf2275bfe5917ae8419cd7e34f13bfc2aa7539a"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"syn",
|
||||
@@ -2107,9 +2113,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "r-efi"
|
||||
version = "5.2.0"
|
||||
version = "5.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5"
|
||||
checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
|
||||
|
||||
[[package]]
|
||||
name = "rand"
|
||||
@@ -2201,6 +2207,26 @@ dependencies = [
|
||||
"bitflags 2.9.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ref-cast"
|
||||
version = "1.0.24"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf"
|
||||
dependencies = [
|
||||
"ref-cast-impl",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ref-cast-impl"
|
||||
version = "1.0.24"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "regex"
|
||||
version = "1.11.1"
|
||||
@@ -2359,9 +2385,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rustls"
|
||||
version = "0.23.27"
|
||||
version = "0.23.28"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "730944ca083c1c233a75c09f199e973ca499344a2b7ba9e755c457e86fb4a321"
|
||||
checksum = "7160e3e10bf4535308537f3c4e1641468cd0e485175d6163087c0393c7d46643"
|
||||
dependencies = [
|
||||
"aws-lc-rs",
|
||||
"log",
|
||||
@@ -2481,6 +2507,18 @@ dependencies = [
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "schemars"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f"
|
||||
dependencies = [
|
||||
"dyn-clone",
|
||||
"ref-cast",
|
||||
"serde",
|
||||
"serde_json",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "scoped-tls"
|
||||
version = "1.0.1"
|
||||
@@ -2595,15 +2633,16 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "serde_with"
|
||||
version = "3.12.0"
|
||||
version = "3.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d6b6f7f2fcb69f747921f79f3926bd1e203fce4fef62c268dd3abfb6d86029aa"
|
||||
checksum = "bf65a400f8f66fb7b0552869ad70157166676db75ed8181f8104ea91cf9d0b42"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"chrono",
|
||||
"hex",
|
||||
"indexmap 1.9.3",
|
||||
"indexmap 2.9.0",
|
||||
"indexmap 2.10.0",
|
||||
"schemars",
|
||||
"serde",
|
||||
"serde_derive",
|
||||
"serde_json",
|
||||
@@ -2613,9 +2652,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "serde_with_macros"
|
||||
version = "3.12.0"
|
||||
version = "3.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8d00caa5193a3c8362ac2b73be6b9e768aa5a4b2f721d8f4b339600c3cb51f8e"
|
||||
checksum = "81679d9ed988d5e9a5e6531dc3f2c28efbd639cbd1dfb628df08edea6004da77"
|
||||
dependencies = [
|
||||
"darling",
|
||||
"proc-macro2",
|
||||
@@ -2629,7 +2668,7 @@ version = "0.9.34+deprecated"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47"
|
||||
dependencies = [
|
||||
"indexmap 2.9.0",
|
||||
"indexmap 2.10.0",
|
||||
"itoa",
|
||||
"ryu",
|
||||
"serde",
|
||||
@@ -2725,12 +2764,9 @@ checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e"
|
||||
|
||||
[[package]]
|
||||
name = "slab"
|
||||
version = "0.4.9"
|
||||
version = "0.4.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
]
|
||||
checksum = "04dc19736151f35336d325007ac991178d504a119863a2fcb3758cdb5e52c50d"
|
||||
|
||||
[[package]]
|
||||
name = "smallvec"
|
||||
@@ -2791,9 +2827,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "2.0.103"
|
||||
version = "2.0.104"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e4307e30089d6fd6aff212f2da3a1f9e32f3223b1f010fb09b7c95f90f3ca1e8"
|
||||
checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@@ -3106,7 +3142,7 @@ version = "0.22.27"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a"
|
||||
dependencies = [
|
||||
"indexmap 2.9.0",
|
||||
"indexmap 2.10.0",
|
||||
"toml_datetime",
|
||||
"winnow",
|
||||
]
|
||||
@@ -3131,9 +3167,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tracing-attributes"
|
||||
version = "0.1.29"
|
||||
version = "0.1.30"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1b1ffbcf9c6f6b99d386e7444eb608ba646ae452a36b39737deb9663b610f662"
|
||||
checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@@ -3386,14 +3422,14 @@ version = "0.26.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "75c7f0ef91146ebfb530314f5f1d24528d7f0767efbfd31dce919275413e393e"
|
||||
dependencies = [
|
||||
"webpki-root-certs 1.0.0",
|
||||
"webpki-root-certs 1.0.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "webpki-root-certs"
|
||||
version = "1.0.0"
|
||||
version = "1.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "01a83f7e1a9f8712695c03eabe9ed3fbca0feff0152f33f12593e5a6303cb1a4"
|
||||
checksum = "86138b15b2b7d561bc4469e77027b8dd005a43dc502e9031d1f5afc8ce1f280e"
|
||||
dependencies = [
|
||||
"rustls-pki-types",
|
||||
]
|
||||
@@ -3591,6 +3627,15 @@ dependencies = [
|
||||
"windows-targets 0.52.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-sys"
|
||||
version = "0.60.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
|
||||
dependencies = [
|
||||
"windows-targets 0.53.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-targets"
|
||||
version = "0.42.2"
|
||||
@@ -3878,7 +3923,7 @@ checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb"
|
||||
|
||||
[[package]]
|
||||
name = "wstunnel"
|
||||
version = "10.4.2"
|
||||
version = "10.4.3"
|
||||
dependencies = [
|
||||
"ahash",
|
||||
"anyhow",
|
||||
@@ -3935,7 +3980,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wstunnel-cli"
|
||||
version = "10.4.2"
|
||||
version = "10.4.3"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
@@ -3966,9 +4011,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "xattr"
|
||||
version = "1.5.0"
|
||||
version = "1.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0d65cbf2f12c15564212d48f4e3dfb87923d25d611f2aed18f4cb23f0413d89e"
|
||||
checksum = "af3a19837351dc82ba89f8a125e22a3c475f05aba604acc023d62b2739ae2909"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"rustix 1.0.7",
|
||||
@@ -4009,18 +4054,18 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "zerocopy"
|
||||
version = "0.8.25"
|
||||
version = "0.8.26"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb"
|
||||
checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f"
|
||||
dependencies = [
|
||||
"zerocopy-derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zerocopy-derive"
|
||||
version = "0.8.25"
|
||||
version = "0.8.26"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef"
|
||||
checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
@@ -97,14 +97,14 @@ async fn main() -> anyhow::Result<()> {
|
||||
run_client(*args, DefaultTokioExecutor::default())
|
||||
.await
|
||||
.unwrap_or_else(|err| {
|
||||
panic!("Cannot start wstunnel client: {:?}", err);
|
||||
panic!("Cannot start wstunnel client: {err:?}");
|
||||
});
|
||||
}
|
||||
Commands::Server(args) => {
|
||||
run_server(*args, DefaultTokioExecutor::default())
|
||||
.await
|
||||
.unwrap_or_else(|err| {
|
||||
panic!("Cannot start wstunnel server: {:?}", err);
|
||||
panic!("Cannot start wstunnel server: {err:?}");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -439,7 +439,7 @@ mod parsers {
|
||||
let Ok(secs) = arg.parse::<u64>() else {
|
||||
return Err(Error::new(
|
||||
ErrorKind::InvalidInput,
|
||||
format!("cannot parse duration of seconds from {}", arg),
|
||||
format!("cannot parse duration of seconds from {arg}"),
|
||||
));
|
||||
};
|
||||
|
||||
@@ -454,13 +454,13 @@ mod parsers {
|
||||
let Some((ipv6_str, remaining)) = arg.split_once(']') else {
|
||||
return Err(Error::new(
|
||||
ErrorKind::InvalidInput,
|
||||
format!("cannot parse IPv6 bind from {}", arg),
|
||||
format!("cannot parse IPv6 bind from {arg}"),
|
||||
));
|
||||
};
|
||||
let Ok(ipv6_addr) = Ipv6Addr::from_str(&ipv6_str[1..]) else {
|
||||
return Err(Error::new(
|
||||
ErrorKind::InvalidInput,
|
||||
format!("cannot parse IPv6 bind from {}", ipv6_str),
|
||||
format!("cannot parse IPv6 bind from {ipv6_str}"),
|
||||
));
|
||||
};
|
||||
|
||||
@@ -480,7 +480,7 @@ mod parsers {
|
||||
let Ok(bind_port): Result<u16, _> = port_str.parse() else {
|
||||
return Err(Error::new(
|
||||
ErrorKind::InvalidInput,
|
||||
format!("cannot parse bind port from {}", port_str),
|
||||
format!("cannot parse bind port from {port_str}"),
|
||||
));
|
||||
};
|
||||
|
||||
@@ -492,17 +492,17 @@ mod parsers {
|
||||
use std::io::Error;
|
||||
|
||||
// Using http or else the URL lib don't try to fully parse the host into an IPv4/IPv6
|
||||
let Ok(remote) = Url::parse(&format!("https://{}", remaining)) else {
|
||||
let Ok(remote) = Url::parse(&format!("https://{remaining}")) else {
|
||||
return Err(Error::new(
|
||||
ErrorKind::InvalidInput,
|
||||
format!("cannot parse remote from {}", remaining),
|
||||
format!("cannot parse remote from {remaining}"),
|
||||
));
|
||||
};
|
||||
|
||||
let Some(remote_host) = remote.host() else {
|
||||
return Err(Error::new(
|
||||
ErrorKind::InvalidInput,
|
||||
format!("cannot parse remote host from {}", remaining),
|
||||
format!("cannot parse remote host from {remaining}"),
|
||||
));
|
||||
};
|
||||
|
||||
@@ -513,7 +513,7 @@ mod parsers {
|
||||
_ => {
|
||||
return Err(Error::new(
|
||||
ErrorKind::InvalidInput,
|
||||
format!("cannot parse remote port from {}", remaining),
|
||||
format!("cannot parse remote port from {remaining}"),
|
||||
));
|
||||
}
|
||||
};
|
||||
@@ -541,7 +541,7 @@ mod parsers {
|
||||
let Some((proto, tunnel_info)) = arg.split_once("://") else {
|
||||
return Err(Error::new(
|
||||
ErrorKind::InvalidInput,
|
||||
format!("cannot parse protocol from {}", arg),
|
||||
format!("cannot parse protocol from {arg}"),
|
||||
));
|
||||
};
|
||||
|
||||
@@ -573,7 +573,7 @@ mod parsers {
|
||||
let Some((path, remote)) = tunnel_info.split_once(':') else {
|
||||
return Err(Error::new(
|
||||
ErrorKind::InvalidInput,
|
||||
format!("cannot parse unix socket path from {}", arg),
|
||||
format!("cannot parse unix socket path from {arg}"),
|
||||
));
|
||||
};
|
||||
let (dest_host, dest_port, options) = parse_tunnel_dest(remote)?;
|
||||
@@ -588,7 +588,7 @@ mod parsers {
|
||||
}
|
||||
"http" => {
|
||||
let (local_bind, remaining) = parse_local_bind(tunnel_info)?;
|
||||
let x = format!("0.0.0.0:0?{}", remaining);
|
||||
let x = format!("0.0.0.0:0?{remaining}");
|
||||
let (dest_host, dest_port, options) = parse_tunnel_dest(&x)?;
|
||||
Ok(LocalToRemote {
|
||||
local_protocol: LocalProtocol::HttpProxy {
|
||||
@@ -602,7 +602,7 @@ mod parsers {
|
||||
}
|
||||
"socks5" => {
|
||||
let (local_bind, remaining) = parse_local_bind(tunnel_info)?;
|
||||
let x = format!("0.0.0.0:0?{}", remaining);
|
||||
let x = format!("0.0.0.0:0?{remaining}");
|
||||
let (dest_host, dest_port, options) = parse_tunnel_dest(&x)?;
|
||||
Ok(LocalToRemote {
|
||||
local_protocol: LocalProtocol::Socks5 {
|
||||
@@ -625,7 +625,7 @@ mod parsers {
|
||||
}
|
||||
"tproxy+tcp" => {
|
||||
let (local_bind, remaining) = parse_local_bind(tunnel_info)?;
|
||||
let x = format!("0.0.0.0:0?{}", remaining);
|
||||
let x = format!("0.0.0.0:0?{remaining}");
|
||||
let (dest_host, dest_port, _options) = parse_tunnel_dest(&x)?;
|
||||
Ok(LocalToRemote {
|
||||
local_protocol: LocalProtocol::TProxyTcp,
|
||||
@@ -635,7 +635,7 @@ mod parsers {
|
||||
}
|
||||
"tproxy+udp" => {
|
||||
let (local_bind, remaining) = parse_local_bind(tunnel_info)?;
|
||||
let x = format!("0.0.0.0:0?{}", remaining);
|
||||
let x = format!("0.0.0.0:0?{remaining}");
|
||||
let (dest_host, dest_port, options) = parse_tunnel_dest(&x)?;
|
||||
Ok(LocalToRemote {
|
||||
local_protocol: LocalProtocol::TProxyUdp {
|
||||
@@ -647,7 +647,7 @@ mod parsers {
|
||||
}
|
||||
_ => Err(Error::new(
|
||||
ErrorKind::InvalidInput,
|
||||
format!("Invalid local protocol for tunnel {}", arg),
|
||||
format!("Invalid local protocol for tunnel {arg}"),
|
||||
)),
|
||||
}
|
||||
}
|
||||
@@ -691,7 +691,7 @@ mod parsers {
|
||||
Ok(val) => Ok(val),
|
||||
Err(err) => Err(io::Error::new(
|
||||
ErrorKind::InvalidInput,
|
||||
format!("Invalid sni override: {}", err),
|
||||
format!("Invalid sni override: {err}"),
|
||||
)),
|
||||
}
|
||||
}
|
||||
@@ -700,7 +700,7 @@ mod parsers {
|
||||
let Some((key, value)) = arg.split_once(':') else {
|
||||
return Err(io::Error::new(
|
||||
ErrorKind::InvalidInput,
|
||||
format!("cannot parse http header from {}", arg),
|
||||
format!("cannot parse http header from {arg}"),
|
||||
));
|
||||
};
|
||||
|
||||
@@ -709,7 +709,7 @@ mod parsers {
|
||||
Err(err) => {
|
||||
return Err(io::Error::new(
|
||||
ErrorKind::InvalidInput,
|
||||
format!("cannot parse http header value from {} due to {:?}", value, err),
|
||||
format!("cannot parse http header value from {value} due to {err:?}"),
|
||||
));
|
||||
}
|
||||
};
|
||||
@@ -719,10 +719,10 @@ mod parsers {
|
||||
|
||||
pub fn parse_http_credentials(arg: &str) -> Result<HeaderValue, io::Error> {
|
||||
let encoded = base64::engine::general_purpose::STANDARD.encode(arg.trim().as_bytes());
|
||||
let Ok(header) = HeaderValue::from_str(&format!("Basic {}", encoded)) else {
|
||||
let Ok(header) = HeaderValue::from_str(&format!("Basic {encoded}")) else {
|
||||
return Err(io::Error::new(
|
||||
ErrorKind::InvalidInput,
|
||||
format!("cannot parse http credentials {}", arg),
|
||||
format!("cannot parse http credentials {arg}"),
|
||||
));
|
||||
};
|
||||
|
||||
@@ -733,7 +733,7 @@ mod parsers {
|
||||
let Ok(url) = Url::parse(arg) else {
|
||||
return Err(io::Error::new(
|
||||
ErrorKind::InvalidInput,
|
||||
format!("cannot parse server url {}", arg),
|
||||
format!("cannot parse server url {arg}"),
|
||||
));
|
||||
};
|
||||
|
||||
@@ -745,7 +745,7 @@ mod parsers {
|
||||
}
|
||||
|
||||
if url.host().is_none() {
|
||||
return Err(io::Error::new(ErrorKind::InvalidInput, format!("invalid server host {}", arg)));
|
||||
return Err(io::Error::new(ErrorKind::InvalidInput, format!("invalid server host {arg}")));
|
||||
}
|
||||
|
||||
Ok(url)
|
||||
|
@@ -529,7 +529,7 @@ async fn run_server_impl(args: Server, executor: impl TokioExecutorRef) -> anyho
|
||||
env!("CARGO_PKG_VERSION"),
|
||||
server.config
|
||||
);
|
||||
debug!("Restriction rules: {:#?}", restrictions);
|
||||
debug!("Restriction rules: {restrictions:#?}");
|
||||
server.serve(restrictions).await
|
||||
}
|
||||
|
||||
@@ -545,7 +545,7 @@ fn mk_http_proxy(
|
||||
let mut proxy = if proxy.starts_with("http://") {
|
||||
Url::parse(&proxy).with_context(|| "Invalid http proxy url")?
|
||||
} else {
|
||||
Url::parse(&format!("http://{}", proxy)).with_context(|| "Invalid http proxy url")?
|
||||
Url::parse(&format!("http://{proxy}")).with_context(|| "Invalid http proxy url")?
|
||||
};
|
||||
|
||||
if let Some(login) = proxy_login {
|
||||
|
@@ -51,7 +51,7 @@ pub enum DnsResolver {
|
||||
impl DnsResolver {
|
||||
pub async fn lookup_host(&self, domain: &str, port: u16) -> anyhow::Result<Vec<SocketAddr>> {
|
||||
let addrs = match self {
|
||||
Self::System => tokio::net::lookup_host(format!("{}:{}", domain, port)).await?.collect(),
|
||||
Self::System => tokio::net::lookup_host(format!("{domain}:{port}")).await?.collect(),
|
||||
Self::TrustDns { resolver, prefer_ipv6 } => {
|
||||
let addrs: Vec<_> = resolver
|
||||
.lookup_ip(domain)
|
||||
|
@@ -82,13 +82,12 @@ pub async fn run_server(
|
||||
credentials: Option<(String, String)>,
|
||||
) -> Result<HttpProxyListener, anyhow::Error> {
|
||||
info!(
|
||||
"Starting http proxy server listening cnx on {} with credentials {:?}",
|
||||
bind, credentials
|
||||
"Starting http proxy server listening cnx on {bind} with credentials {credentials:?}"
|
||||
);
|
||||
|
||||
let listener = TcpListener::bind(bind)
|
||||
.await
|
||||
.with_context(|| format!("Cannot create TCP server {:?}", bind))?;
|
||||
.with_context(|| format!("Cannot create TCP server {bind:?}"))?;
|
||||
|
||||
let http1 = {
|
||||
let mut builder = http1::Builder::new();
|
||||
@@ -99,7 +98,7 @@ pub async fn run_server(
|
||||
builder
|
||||
};
|
||||
let auth_header =
|
||||
credentials.map(|(user, pass)| base64::engine::general_purpose::STANDARD.encode(format!("{}:{}", user, pass)));
|
||||
credentials.map(|(user, pass)| base64::engine::general_purpose::STANDARD.encode(format!("{user}:{pass}")));
|
||||
let tasks = JoinSet::<Option<(TcpStream, Option<(Host, u16)>)>>::new();
|
||||
|
||||
let proxy_cfg = Arc::new((auth_header, http1));
|
||||
@@ -117,7 +116,7 @@ pub async fn run_server(
|
||||
},
|
||||
None | Some(Ok(None)) => continue,
|
||||
Some(Err(err)) => {
|
||||
error!("Error while joinning tasks {:?}", err);
|
||||
error!("Error while joinning tasks {err:?}");
|
||||
continue
|
||||
},
|
||||
}
|
||||
@@ -127,7 +126,7 @@ pub async fn run_server(
|
||||
match stream {
|
||||
Ok((stream, _)) => (stream, None),
|
||||
Err(err) => {
|
||||
error!("Error while accepting connection {:?}", err);
|
||||
error!("Error while accepting connection {err:?}");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -152,7 +151,7 @@ pub async fn run_server(
|
||||
match conn_fut.await {
|
||||
Ok(_) => Some((stream, forward_to.into_inner())),
|
||||
Err(err) => {
|
||||
info!("Error while serving connection: {}", err);
|
||||
info!("Error while serving connection: {err}");
|
||||
None
|
||||
}
|
||||
}
|
||||
|
@@ -79,7 +79,7 @@ pub async fn run_server(
|
||||
|
||||
let server = Socks5Server::<DenyAuthentication>::bind(bind)
|
||||
.await
|
||||
.with_context(|| format!("Cannot create socks5 server {:?}", bind))?;
|
||||
.with_context(|| format!("Cannot create socks5 server {bind:?}"))?;
|
||||
|
||||
let mut cfg = Config::default();
|
||||
cfg = if let Some((username, password)) = credentials {
|
||||
|
@@ -44,7 +44,7 @@ impl Socks5UdpServer {
|
||||
const BUF_SIZES: [usize; 7] = [64usize, 32usize, 16usize, 8usize, 4usize, 2usize, 1usize];
|
||||
for size in BUF_SIZES.iter() {
|
||||
if let Err(err) = socket.set_recv_buffer_size(size * 1024 * 1024) {
|
||||
warn!("Cannot increase UDP server recv buffer to {} Mib: {}", size, err);
|
||||
warn!("Cannot increase UDP server recv buffer to {size} Mib: {err}");
|
||||
warn!(
|
||||
"This is not fatal, but can lead to packet loss if you have too much throughput. You must monitor packet loss in this case"
|
||||
);
|
||||
@@ -60,7 +60,7 @@ impl Socks5UdpServer {
|
||||
|
||||
for size in BUF_SIZES.iter() {
|
||||
if let Err(err) = socket.set_send_buffer_size(size * 1024 * 1024) {
|
||||
warn!("Cannot increase UDP server send buffer to {} Mib: {}", size, err);
|
||||
warn!("Cannot increase UDP server send buffer to {size} Mib: {err}");
|
||||
warn!(
|
||||
"This is not fatal, but can lead to packet loss if you have too much throughput. You must monitor packet loss in this case"
|
||||
);
|
||||
@@ -236,7 +236,7 @@ pub async fn run_server(
|
||||
) -> Result<impl Stream<Item = io::Result<Socks5UdpStream>>, anyhow::Error> {
|
||||
let listener = UdpSocket::bind(bind)
|
||||
.await
|
||||
.with_context(|| format!("Cannot create UDP server {:?}", bind))?;
|
||||
.with_context(|| format!("Cannot create UDP server {bind:?}"))?;
|
||||
|
||||
let udp_server = Socks5UdpServer::new(listener, timeout);
|
||||
static MAX_PACKET_LENGTH: usize = 64 * 1024;
|
||||
@@ -259,7 +259,7 @@ pub async fn run_server(
|
||||
let (frag, destination_addr, data) = match fast_socks5::parse_udp_request(payload.chunk()).await {
|
||||
Ok((frag, addr, data)) => (frag, addr, data),
|
||||
Err(err) => {
|
||||
warn!("Skipping invalid UDP socks5 request: {} ", err);
|
||||
warn!("Skipping invalid UDP socks5 request: {err} ");
|
||||
debug!("Invalid UDP socks5 request: {:?}", payload.chunk());
|
||||
continue;
|
||||
}
|
||||
|
@@ -54,13 +54,13 @@ pub async fn connect(
|
||||
connect_timeout: Duration,
|
||||
dns_resolver: &DnsResolver,
|
||||
) -> Result<TcpStream, anyhow::Error> {
|
||||
info!("Opening TCP connection to {}:{}", host, port);
|
||||
info!("Opening TCP connection to {host}:{port}");
|
||||
|
||||
let socket_addrs: Vec<SocketAddr> = match host {
|
||||
Host::Domain(domain) => dns_resolver
|
||||
.lookup_host(domain.as_str(), port)
|
||||
.await
|
||||
.with_context(|| format!("cannot resolve domain: {}", domain))?,
|
||||
.with_context(|| format!("cannot resolve domain: {domain}"))?,
|
||||
Host::Ipv4(ip) => vec![SocketAddr::V4(SocketAddrV4::new(*ip, port))],
|
||||
Host::Ipv6(ip) => vec![SocketAddr::V6(SocketAddrV6::new(*ip, port, 0, 0))],
|
||||
};
|
||||
@@ -150,11 +150,11 @@ pub async fn connect_with_http_proxy(
|
||||
debug!("Connected to http proxy {}", socket.peer_addr()?);
|
||||
|
||||
let authorization = if let Some((user, password)) = proxy.password().map(|p| (proxy.username(), p)) {
|
||||
let user = urlencoding::decode(user).with_context(|| format!("Cannot urldecode proxy user: {}", user))?;
|
||||
let user = urlencoding::decode(user).with_context(|| format!("Cannot urldecode proxy user: {user}"))?;
|
||||
let password =
|
||||
urlencoding::decode(password).with_context(|| format!("Cannot urldecode proxy password: {}", password))?;
|
||||
let creds = base64::engine::general_purpose::STANDARD.encode(format!("{}:{}", user, password));
|
||||
format!("Proxy-Authorization: Basic {}\r\n", creds)
|
||||
urlencoding::decode(password).with_context(|| format!("Cannot urldecode proxy password: {password}"))?;
|
||||
let creds = base64::engine::general_purpose::STANDARD.encode(format!("{user}:{password}"));
|
||||
format!("Proxy-Authorization: Basic {creds}\r\n")
|
||||
} else {
|
||||
"".to_string()
|
||||
};
|
||||
@@ -210,11 +210,11 @@ pub async fn connect_with_http_proxy(
|
||||
|
||||
#[cfg_attr(not(target_os = "linux"), expect(unused_variables))]
|
||||
pub async fn run_server(bind: SocketAddr, ip_transparent: bool) -> Result<TcpListenerStream, anyhow::Error> {
|
||||
info!("Starting TCP server listening cnx on {}", bind);
|
||||
info!("Starting TCP server listening cnx on {bind}");
|
||||
|
||||
let listener = TcpListener::bind(bind)
|
||||
.await
|
||||
.with_context(|| format!("Cannot create TCP server {:?}", bind))?;
|
||||
.with_context(|| format!("Cannot create TCP server {bind:?}"))?;
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
if ip_transparent {
|
||||
|
@@ -83,7 +83,7 @@ pub fn load_certificates_from_pem(path: &Path) -> anyhow::Result<Vec<Certificate
|
||||
.filter_map(|cert| match cert {
|
||||
Ok(cert) => Some(cert),
|
||||
Err(err) => {
|
||||
warn!("Error while parsing tls certificate: {:?}", err);
|
||||
warn!("Error while parsing tls certificate: {err:?}");
|
||||
None
|
||||
}
|
||||
})
|
||||
@@ -116,11 +116,11 @@ pub fn tls_connector(
|
||||
// Load system certificates and add them to the root store
|
||||
let certs = rustls_native_certs::load_native_certs();
|
||||
certs.errors.iter().for_each(|err| {
|
||||
warn!("cannot load system some system certificates: {}", err);
|
||||
warn!("cannot load system some system certificates: {err}");
|
||||
});
|
||||
for cert in certs.certs {
|
||||
if let Err(err) = root_store.add(cert) {
|
||||
warn!("cannot load a system certificate: {:?}", err);
|
||||
warn!("cannot load a system certificate: {err:?}");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@@ -46,7 +46,7 @@ impl UdpServer {
|
||||
const BUF_SIZES: [usize; 7] = [64usize, 32usize, 16usize, 8usize, 4usize, 2usize, 1usize];
|
||||
for size in BUF_SIZES.iter() {
|
||||
if let Err(err) = socket.set_recv_buffer_size(size * 1024 * 1024) {
|
||||
warn!("Cannot increase UDP server recv buffer to {} Mib: {}", size, err);
|
||||
warn!("Cannot increase UDP server recv buffer to {size} Mib: {err}");
|
||||
warn!(
|
||||
"This is not fatal, but can lead to packet loss if you have too much throughput. You must monitor packet loss in this case"
|
||||
);
|
||||
@@ -62,7 +62,7 @@ impl UdpServer {
|
||||
|
||||
for size in BUF_SIZES.iter() {
|
||||
if let Err(err) = socket.set_send_buffer_size(size * 1024 * 1024) {
|
||||
warn!("Cannot increase UDP server send buffer to {} Mib: {}", size, err);
|
||||
warn!("Cannot increase UDP server send buffer to {size} Mib: {err}");
|
||||
warn!(
|
||||
"This is not fatal, but can lead to packet loss if you have too much throughput. You must monitor packet loss in this case"
|
||||
);
|
||||
@@ -251,7 +251,7 @@ pub async fn run_server(
|
||||
|
||||
let listener = UdpSocket::bind(bind)
|
||||
.await
|
||||
.with_context(|| format!("Cannot create UDP server {:?}", bind))?;
|
||||
.with_context(|| format!("Cannot create UDP server {bind:?}"))?;
|
||||
configure_listener(&listener)?;
|
||||
|
||||
let udp_server = UdpServer::new(listener, timeout);
|
||||
@@ -347,7 +347,7 @@ pub async fn connect(
|
||||
Host::Domain(domain) => dns_resolver
|
||||
.lookup_host(domain.as_str(), port)
|
||||
.await
|
||||
.with_context(|| format!("cannot resolve domain: {}", domain))?,
|
||||
.with_context(|| format!("cannot resolve domain: {domain}"))?,
|
||||
Host::Ipv4(ip) => vec![SocketAddr::V4(SocketAddrV4::new(*ip, port))],
|
||||
Host::Ipv6(ip) => vec![SocketAddr::V6(SocketAddrV6::new(*ip, port, 0, 0))],
|
||||
};
|
||||
@@ -365,7 +365,7 @@ pub async fn connect(
|
||||
let socket = match socket {
|
||||
Ok(socket) => socket,
|
||||
Err(err) => {
|
||||
warn!("cannot bind udp socket {:?}", err);
|
||||
warn!("cannot bind udp socket {err:?}");
|
||||
continue;
|
||||
}
|
||||
};
|
||||
@@ -482,7 +482,7 @@ pub fn mk_send_socket_tproxy(listener: &Arc<UdpSocket>) -> anyhow::Result<Arc<Ud
|
||||
);
|
||||
}
|
||||
_ => {
|
||||
warn!("Unknown control message {:?}", cmsg);
|
||||
warn!("Unknown control message {cmsg:?}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -48,11 +48,11 @@ impl Stream for UnixListenerStream {
|
||||
}
|
||||
|
||||
pub async fn run_server(socket_path: &Path) -> Result<UnixListenerStream, anyhow::Error> {
|
||||
info!("Starting Unix socket server listening cnx on {:?}", socket_path);
|
||||
info!("Starting Unix socket server listening cnx on {socket_path:?}");
|
||||
|
||||
let path_to_delete = !socket_path.exists();
|
||||
let listener = UnixListener::bind(socket_path)
|
||||
.with_context(|| format!("Cannot create Unix socket server {:?}", socket_path))?;
|
||||
.with_context(|| format!("Cannot create Unix socket server {socket_path:?}"))?;
|
||||
|
||||
Ok(UnixListenerStream::new(listener, path_to_delete))
|
||||
}
|
||||
|
@@ -148,7 +148,7 @@ impl RestrictionsRulesReloader {
|
||||
return;
|
||||
}
|
||||
|
||||
trace!("Received event: {:#?}", event);
|
||||
trace!("Received event: {event:#?}");
|
||||
if let Some(path) = event.paths.iter().find(|p| p.ends_with(&this.config_path)) {
|
||||
match event.kind {
|
||||
EventKind::Create(_) | EventKind::Modify(_) => {
|
||||
@@ -159,7 +159,7 @@ impl RestrictionsRulesReloader {
|
||||
Self::try_rewatch_config(reloader.clone(), path.to_path_buf());
|
||||
}
|
||||
EventKind::Access(_) | EventKind::Other | EventKind::Any => {
|
||||
trace!("Ignoring event {:?}", event);
|
||||
trace!("Ignoring event {event:?}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -78,7 +78,7 @@ impl RestrictionsRules {
|
||||
.map(|path_prefix| {
|
||||
let reg = Regex::new(&format!("^{}$", regex::escape(path_prefix)))?;
|
||||
Ok(types::RestrictionConfig {
|
||||
name: format!("Allow path prefix {}", path_prefix),
|
||||
name: format!("Allow path prefix {path_prefix}"),
|
||||
r#match: vec![types::MatchConfig::PathPrefix(reg)],
|
||||
allow: tunnels_restrictions.clone(),
|
||||
})
|
||||
|
@@ -130,8 +130,7 @@ where
|
||||
let port_mapping_parts: Vec<&str> = port_mapping.split(':').collect();
|
||||
if port_mapping_parts.len() != 2 {
|
||||
Err(serde::de::Error::custom(format!(
|
||||
"Invalid port_mapping entry: {}",
|
||||
port_mapping
|
||||
"Invalid port_mapping entry: {port_mapping}"
|
||||
)))
|
||||
} else {
|
||||
let orig_port = port_mapping_parts[0].parse::<u16>().map_err(serde::de::Error::custom)?;
|
||||
|
@@ -84,7 +84,7 @@ impl<E: TokioExecutorRef> WsClient<E> {
|
||||
}
|
||||
};
|
||||
|
||||
debug!("Server response: {:?}", response);
|
||||
debug!("Server response: {response:?}");
|
||||
let (local_rx, local_tx) = duplex_stream;
|
||||
let (close_tx, close_rx) = oneshot::channel::<()>();
|
||||
|
||||
|
@@ -204,7 +204,7 @@ impl TlsReloader {
|
||||
Self::try_rewatch_certificate(Server(this.clone()), path.to_path_buf());
|
||||
}
|
||||
EventKind::Access(_) | EventKind::Other | EventKind::Any => {
|
||||
trace!("Ignoring event {:?}", event);
|
||||
trace!("Ignoring event {event:?}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -226,7 +226,7 @@ impl TlsReloader {
|
||||
Self::try_rewatch_certificate(Server(this.clone()), path.to_path_buf());
|
||||
}
|
||||
EventKind::Access(_) | EventKind::Other | EventKind::Any => {
|
||||
trace!("Ignoring event {:?}", event);
|
||||
trace!("Ignoring event {event:?}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -253,7 +253,7 @@ impl TlsReloader {
|
||||
Self::try_rewatch_certificate(Server(this.clone()), path.to_path_buf());
|
||||
}
|
||||
EventKind::Access(_) | EventKind::Other | EventKind::Any => {
|
||||
trace!("Ignoring event {:?}", event);
|
||||
trace!("Ignoring event {event:?}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -314,7 +314,7 @@ impl TlsReloader {
|
||||
Self::try_rewatch_certificate(Client(this.clone()), path.to_path_buf());
|
||||
}
|
||||
EventKind::Access(_) | EventKind::Other | EventKind::Any => {
|
||||
trace!("Ignoring event {:?}", event);
|
||||
trace!("Ignoring event {event:?}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -358,7 +358,7 @@ impl TlsReloader {
|
||||
Self::try_rewatch_certificate(Client(this.clone()), path.to_path_buf());
|
||||
}
|
||||
EventKind::Access(_) | EventKind::Other | EventKind::Any => {
|
||||
trace!("Ignoring event {:?}", event);
|
||||
trace!("Ignoring event {event:?}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -56,7 +56,7 @@ impl TunnelRead for Http2TunnelRead {
|
||||
};
|
||||
}
|
||||
Err(err) => {
|
||||
warn!("{:?}", err);
|
||||
warn!("{err:?}");
|
||||
continue;
|
||||
}
|
||||
},
|
||||
@@ -201,7 +201,7 @@ pub async fn connect(
|
||||
client.config.remote_addr
|
||||
)
|
||||
})?;
|
||||
debug!("with HTTP upgrade request {:?}", req);
|
||||
debug!("with HTTP upgrade request {req:?}");
|
||||
let transport = pooled_cnx.deref_mut().take().unwrap();
|
||||
let (mut request_sender, cnx) = hyper::client::conn::http2::Builder::new(TokioExecutor::new())
|
||||
.timer(TokioTimer::new())
|
||||
@@ -214,7 +214,7 @@ pub async fn connect(
|
||||
.with_context(|| format!("failed to do http2 handshake with the server {:?}", client.config.remote_addr))?;
|
||||
let cnx_poller = client.executor.spawn(async move {
|
||||
if let Err(err) = cnx.await {
|
||||
error!("{:?}", err)
|
||||
error!("{err:?}")
|
||||
}
|
||||
});
|
||||
|
||||
|
@@ -297,7 +297,7 @@ pub async fn connect(
|
||||
client_cfg.remote_addr
|
||||
)
|
||||
})?;
|
||||
debug!("with HTTP upgrade request {:?}", req);
|
||||
debug!("with HTTP upgrade request {req:?}");
|
||||
let transport = pooled_cnx.deref_mut().take().unwrap();
|
||||
let (ws, response) = fastwebsockets::handshake::client(&TokioExecutor::new(), req, transport)
|
||||
.await
|
||||
|
Reference in New Issue
Block a user