Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9b6c18f

Browse files
committedFeb 20, 2025·
build: add native-tls integration
1 parent aed4e6b commit 9b6c18f

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed
 

‎eventsource-client/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ exclude = ["CHANGELOG.md"]
1313
futures = "0.3.21"
1414
hyper = { version = "0.14.19", features = ["client", "http1", "tcp"] }
1515
hyper-rustls = { version = "0.24.1", optional = true }
16+
hyper-tls = { version = "0.5", optional = true }
1617
log = "0.4.6"
1718
pin-project = "1.0.10"
1819
tokio = { version = "1.17.0", features = ["time"] }
@@ -27,10 +28,10 @@ tokio = { version = "1.2.0", features = ["macros", "rt-multi-thread"] }
2728
test-case = "3.2.1"
2829
proptest = "1.0.0"
2930

30-
3131
[features]
3232
default = ["rustls"]
3333
rustls = ["hyper-rustls", "hyper-rustls/http2"]
34+
native-tls = ["hyper-tls"]
3435

3536
[[example]]
3637
name = "tail"

‎eventsource-client/examples/tail.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,12 @@ async fn main() -> Result<(), es::Error> {
2626
.backoff_factor(2)
2727
.delay_max(Duration::from_secs(60))
2828
.build(),
29-
)
30-
.build();
29+
);
30+
#[cfg(feature = "rustls")]
31+
let client = client.build();
32+
33+
#[cfg(feature = "native-tls")]
34+
let client = client.build_http();
3135

3236
let mut stream = tail_events(client);
3337

0 commit comments

Comments
 (0)
Please sign in to comment.