Skip to content

Commit 5af34b2

Browse files
committed
Turbopack: Remove unused proxy option in turbo-tasks-fetch, document HTTP_PROXY/HTTPS_PROXY environment variables
1 parent af77575 commit 5af34b2

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

crates/next-core/src/next_config.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1740,7 +1740,6 @@ impl NextConfig {
17401740
.or(self.experimental.turbopack_use_system_tls_certs)
17411741
.unwrap_or(false);
17421742
Ok(ReqwestClientConfig {
1743-
proxy: None,
17441743
tls_built_in_webpki_certs: !use_system_tls_certs,
17451744
tls_built_in_native_certs: use_system_tls_certs,
17461745
}

packages/next/src/server/config-schema.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,10 @@ export const configSchema: zod.ZodType<NextConfig> = z.lazy(() =>
481481
*
482482
* This option is ignored on Windows on ARM, where the native TLS inplementation is always
483483
* used.
484+
*
485+
* If you need to set a proxy, Turbopack [respects the common `HTTP_PROXY` and `HTTPS_PROXY`
486+
* environment variable convention](https://docs.rs/reqwest/latest/reqwest/#proxies). HTTP
487+
* proxies are supported, SOCKS proxies are not currently supported.
484488
*/
485489
turbopackUseSystemTlsCerts: z.boolean().optional(),
486490
optimizePackageImports: z.array(z.string()).optional(),

turbopack/crates/turbo-tasks-fetch/src/reqwest_client_cache.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ pub enum ProxyConfig {
2525
#[turbo_tasks::value(shared)]
2626
#[derive(Hash)]
2727
pub struct ReqwestClientConfig {
28-
pub proxy: Option<ProxyConfig>,
2928
/// Whether to load embedded webpki root certs with rustls. Default is true.
3029
///
3130
/// Ignored for:
@@ -44,7 +43,6 @@ pub struct ReqwestClientConfig {
4443
impl Default for ReqwestClientConfig {
4544
fn default() -> Self {
4645
Self {
47-
proxy: None,
4846
tls_built_in_webpki_certs: true,
4947
tls_built_in_native_certs: false,
5048
}
@@ -53,16 +51,7 @@ impl Default for ReqwestClientConfig {
5351

5452
impl ReqwestClientConfig {
5553
fn try_build(&self) -> reqwest::Result<reqwest::Client> {
56-
let mut client_builder = reqwest::Client::builder();
57-
match &self.proxy {
58-
Some(ProxyConfig::Http(proxy)) => {
59-
client_builder = client_builder.proxy(reqwest::Proxy::http(proxy.as_str())?)
60-
}
61-
Some(ProxyConfig::Https(proxy)) => {
62-
client_builder = client_builder.proxy(reqwest::Proxy::https(proxy.as_str())?)
63-
}
64-
None => {}
65-
};
54+
let client_builder = reqwest::Client::builder();
6655

6756
// make sure this cfg matches the one in `Cargo.toml`!
6857
#[cfg(not(any(

0 commit comments

Comments
 (0)