Skip to content

Commit c5f6e26

Browse files
committed
Net: add a simple HTTP client implementation.
The client is using NGINX connection infrastructure with async wrappers, but the message parser is currently provided by "hyper". There are several shortcomings in this approach, most importantly lack of support for pre-resolved upstreams, keepalive or fine tuning of connection buffering and timeouts. There is a plan to provide a better HTTP client implementation in one of the future releases of ngx-rust and use it as a replacement.
1 parent cbca7ef commit c5f6e26

File tree

8 files changed

+1036
-1
lines changed

8 files changed

+1036
-1
lines changed

Cargo.lock

Lines changed: 226 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ crate-type = ["cdylib"]
1111

1212
[dependencies]
1313
base64 = "0.22.1"
14+
constcat = "0.6.1"
1415
http = "1.3.1"
16+
http-body = "1.0.1"
17+
hyper = { version = "1.6.0", features = ["client", "http1"] }
1518
libc = "0.2.174"
1619
openssl = { version = "0.10.73", features = ["bindgen"] }
1720
openssl-foreign-types = { package = "foreign-types", version = "0.3" }
@@ -30,7 +33,7 @@ rev = "95424ad7143de25124d9bedcbf9241fd72a24705"
3033
git = "https://github.com/nginx/ngx-rust"
3134
rev = "95424ad7143de25124d9bedcbf9241fd72a24705"
3235
default-features = false
33-
features = ["std"]
36+
features = ["async", "std"]
3437

3538
[features]
3639
default = ["export-modules"]

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ use crate::variables::NGX_HTTP_ACME_VARS;
1515

1616
mod conf;
1717
mod jws;
18+
mod net;
1819
mod state;
1920
mod time;
21+
mod util;
2022
mod variables;
2123

2224
#[derive(Debug)]

src/net.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pub mod connection;
2+
pub mod http;
3+
pub mod peer_conn;

0 commit comments

Comments
 (0)