mirror of
https://github.com/denoland/deno.git
synced 2025-01-21 04:52:26 -05:00
Compare commits
2 commits
95e32c3c66
...
0b5cb3d009
Author | SHA1 | Date | |
---|---|---|---|
|
0b5cb3d009 | ||
|
7d6e62c073 |
3 changed files with 20 additions and 2 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -2421,8 +2421,10 @@ dependencies = [
|
|||
"async-trait",
|
||||
"deno_core",
|
||||
"deno_error",
|
||||
"deno_tls",
|
||||
"http-body-util",
|
||||
"hyper 1.4.1",
|
||||
"hyper-rustls",
|
||||
"hyper-util",
|
||||
"log",
|
||||
"once_cell",
|
||||
|
|
|
@ -17,8 +17,10 @@ path = "lib.rs"
|
|||
async-trait.workspace = true
|
||||
deno_core.workspace = true
|
||||
deno_error.workspace = true
|
||||
deno_tls.workspace = true
|
||||
http-body-util.workspace = true
|
||||
hyper.workspace = true
|
||||
hyper-rustls.workspace = true
|
||||
hyper-util.workspace = true
|
||||
log.workspace = true
|
||||
once_cell.workspace = true
|
||||
|
|
|
@ -477,10 +477,14 @@ mod hyper_client {
|
|||
use std::task::Poll;
|
||||
use std::task::{self};
|
||||
|
||||
use deno_tls::create_client_config;
|
||||
use deno_tls::SocketUse;
|
||||
use deno_tls::TlsKeys;
|
||||
use http_body_util::BodyExt;
|
||||
use http_body_util::Full;
|
||||
use hyper::body::Body as HttpBody;
|
||||
use hyper::body::Frame;
|
||||
use hyper_rustls::HttpsConnector;
|
||||
use hyper_util::client::legacy::connect::HttpConnector;
|
||||
use hyper_util::client::legacy::Client;
|
||||
use opentelemetry_http::Bytes;
|
||||
|
@ -494,13 +498,23 @@ mod hyper_client {
|
|||
// same as opentelemetry_http::HyperClient except it uses OtelSharedRuntime
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct HyperClient {
|
||||
inner: Client<HttpConnector, Body>,
|
||||
inner: Client<HttpsConnector<HttpConnector>, Body>,
|
||||
}
|
||||
|
||||
impl HyperClient {
|
||||
pub fn new() -> Self {
|
||||
let tls_config = create_client_config(
|
||||
None,
|
||||
vec![],
|
||||
None,
|
||||
TlsKeys::Null,
|
||||
SocketUse::Http,
|
||||
)
|
||||
.unwrap();
|
||||
let http_connector = HttpConnector::new();
|
||||
let connector = HttpsConnector::from((http_connector, tls_config));
|
||||
Self {
|
||||
inner: Client::builder(OtelSharedRuntime).build(HttpConnector::new()),
|
||||
inner: Client::builder(OtelSharedRuntime).build(connector),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue