Browse Source

version bump

pull/22/head
KaranGauswami 10 months ago
parent
commit
2439b61cac
No known key found for this signature in database GPG Key ID: A4D57BC9D0772045
  1. 113
      Cargo.lock
  2. 8
      Cargo.toml
  3. 6
      src/proxy/mod.rs

113
Cargo.lock

@ -408,7 +408,7 @@ dependencies = [
"futures-core",
"futures-sink",
"futures-util",
"http",
"http 0.2.9",
"indexmap",
"slab",
"tokio",
@ -445,6 +445,17 @@ dependencies = [
"itoa",
]
[[package]]
name = "http"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258"
dependencies = [
"bytes",
"fnv",
"itoa",
]
[[package]]
name = "http-body"
version = "0.4.6"
@ -452,30 +463,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2"
dependencies = [
"bytes",
"http",
"http 0.2.9",
"pin-project-lite",
]
[[package]]
name = "http-body"
version = "1.0.0-rc.2"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "951dfc2e32ac02d67c90c0d65bd27009a635dc9b381a2cc7d284ab01e3a0150d"
checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643"
dependencies = [
"bytes",
"http",
"http 1.1.0",
]
[[package]]
name = "http-body-util"
version = "0.1.0-rc.3"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08ef12f041acdd397010e5fb6433270c147d3b8b2d0a840cd7fff8e531dca5c8"
checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f"
dependencies = [
"bytes",
"futures-util",
"http",
"http-body 1.0.0-rc.2",
"http 1.1.0",
"http-body 1.0.0",
"pin-project-lite",
]
@ -508,7 +519,7 @@ dependencies = [
"futures-core",
"futures-util",
"h2",
"http",
"http 0.2.9",
"http-body 0.4.6",
"httparse",
"httpdate",
@ -523,21 +534,21 @@ dependencies = [
[[package]]
name = "hyper"
version = "1.0.0-rc.4"
version = "1.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d280a71f348bcc670fc55b02b63c53a04ac0bf2daff2980795aeaf53edae10e6"
checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d"
dependencies = [
"bytes",
"futures-channel",
"futures-util",
"http",
"http-body 1.0.0-rc.2",
"http 1.1.0",
"http-body 1.0.0",
"httparse",
"httpdate",
"itoa",
"pin-project-lite",
"smallvec",
"tokio",
"tracing",
"want",
]
@ -556,20 +567,17 @@ dependencies = [
[[package]]
name = "hyper-util"
version = "0.0.0"
source = "git+https://github.com/hyperium/hyper-util.git?rev=229757e565e0935a7a3b1d0f9e9ab88d9310e779#229757e565e0935a7a3b1d0f9e9ab88d9310e779"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56"
dependencies = [
"futures-channel",
"bytes",
"futures-util",
"http",
"hyper 1.0.0-rc.4",
"once_cell",
"http 1.1.0",
"http-body 1.0.0",
"hyper 1.3.1",
"pin-project-lite",
"socket2",
"tokio",
"tower",
"tower-service",
"tracing",
]
[[package]]
@ -853,26 +861,6 @@ version = "2.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
[[package]]
name = "pin-project"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422"
dependencies = [
"pin-project-internal",
]
[[package]]
name = "pin-project-internal"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.66",
]
[[package]]
name = "pin-project-lite"
version = "0.2.13"
@ -974,7 +962,7 @@ dependencies = [
"futures-core",
"futures-util",
"h2",
"http",
"http 0.2.9",
"http-body 0.4.6",
"hyper 0.14.29",
"hyper-tls",
@ -1161,9 +1149,9 @@ dependencies = [
[[package]]
name = "smallvec"
version = "1.11.0"
version = "1.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9"
checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
[[package]]
name = "socket2"
@ -1194,14 +1182,14 @@ dependencies = [
[[package]]
name = "sthp"
version = "0.4.0"
version = "0.5.0-alpha1"
dependencies = [
"bytes",
"clap",
"color-eyre",
"http",
"http 0.2.9",
"http-body-util",
"hyper 1.0.0-rc.4",
"hyper 1.3.1",
"hyper-util",
"reqwest",
"socksprox",
@ -1388,28 +1376,6 @@ dependencies = [
"tokio",
]
[[package]]
name = "tower"
version = "0.4.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c"
dependencies = [
"futures-core",
"futures-util",
"pin-project",
"pin-project-lite",
"tokio",
"tower-layer",
"tower-service",
"tracing",
]
[[package]]
name = "tower-layer"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0"
[[package]]
name = "tower-service"
version = "0.3.2"
@ -1423,7 +1389,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8"
dependencies = [
"cfg-if",
"log",
"pin-project-lite",
"tracing-attributes",
"tracing-core",

8
Cargo.toml

@ -1,6 +1,6 @@
[package]
name = "sthp"
version = "0.4.0"
version = "0.5.0-alpha1"
license = "MIT"
authors = ["Karan Gauswami <[email protected]>"]
edition = "2021"
@ -13,15 +13,15 @@ description = "Convert Socks5 proxy into Http proxy"
[dependencies]
color-eyre = { version = "0.6", default-features = false }
http = "0.2.9"
hyper = { version = "1.0.0-rc.4", features = ["client","server","http1"] }
hyper = { version = "1.3", features = ["client","server","http1"] }
clap = { version = "4", features = ["derive"] }
tokio-socks = "0.5"
tokio = { version = "1.28", features = ["macros", "rt-multi-thread"] }
tokio = { version = "1.38", features = ["macros", "rt-multi-thread"] }
bytes = "1.4.0"
http-body-util = "0.1.0-rc.2"
tracing = "0.1.37"
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] }
hyper-util = { git = "https://github.com/hyperium/hyper-util.git", rev = "229757e565e0935a7a3b1d0f9e9ab88d9310e779" }
hyper-util = { version="0.1.5",features = ["tokio"] }
[dev-dependencies]
socksprox = { version = "0.1" }

6
src/proxy/mod.rs

@ -40,7 +40,7 @@ async fn proxy(
let mut resp = Response::new(full(
"Access to this domain is not allowed through the proxy.",
));
*resp.status_mut() = http::StatusCode::FORBIDDEN;
*resp.status_mut() = hyper::StatusCode::FORBIDDEN;
return Ok(resp);
}
}
@ -62,7 +62,7 @@ async fn proxy(
} else {
warn!("CONNECT host is not socket addr: {:?}", req.uri());
let mut resp = Response::new(full("CONNECT must be to a socket address"));
*resp.status_mut() = http::StatusCode::BAD_REQUEST;
*resp.status_mut() = hyper::StatusCode::BAD_REQUEST;
Ok(resp)
}
@ -100,7 +100,7 @@ async fn proxy(
}
}
fn host_addr(uri: &http::Uri) -> Option<String> {
fn host_addr(uri: &hyper::Uri) -> Option<String> {
uri.authority().map(|auth| auth.to_string())
}

Loading…
Cancel
Save