Skip to content

Commit d641533

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 9cadce0 commit d641533

File tree

8 files changed

+1097
-1
lines changed

8 files changed

+1097
-1
lines changed

Cargo.lock

Lines changed: 241 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: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ crate-type = ["cdylib"]
1111

1212
[dependencies]
1313
base64 = "0.22.1"
14+
bytes = "1.10.1"
15+
constcat = "0.6.1"
1416
http = "1.3.1"
17+
http-body = "1.0.1"
18+
http-body-util = "0.1.3"
19+
hyper = { version = "1.6.0", features = ["client", "http1"] }
1520
libc = "0.2.174"
1621
openssl = { version = "0.10.73", features = ["bindgen"] }
1722
openssl-foreign-types = { package = "foreign-types", version = "0.3" }
@@ -30,7 +35,7 @@ rev = "95424ad7143de25124d9bedcbf9241fd72a24705"
3035
git = "https://github.com/nginx/ngx-rust"
3136
rev = "95424ad7143de25124d9bedcbf9241fd72a24705"
3237
default-features = false
33-
features = ["std"]
38+
features = ["async", "std"]
3439

3540
[features]
3641
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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Copyright (c) F5, Inc.
2+
//
3+
// This source code is licensed under the Apache License, Version 2.0 license found in the
4+
// LICENSE file in the root directory of this source tree.
5+
6+
pub mod connection;
7+
pub mod http;
8+
pub mod peer_conn;

0 commit comments

Comments
 (0)