Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Typed unix socket and TLS options for `BunHttpClient` and `DenoHttpClient`

Cerrado
#9,687 0 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@effect-bot ya está trabajando en esto.

Desde el 21/10/2026.

  • #9704 de @tim-smart — fusionado

Evaluación

Este issue todavía no se ha evaluado.

Descripción

docker-made-me-do-it enhancement platform

Problem

NodeHttpClient has typed layers for connecting over a unix socket and for custom TLS (#9158):

NodeHttpClient.layerUndiciOptions({ connect: { socketPath: "/var/run/docker.sock" } })
NodeHttpClient.layerUndiciOptions({ connect: { ca, cert, key, servername } })

Bun and Deno have nothing equivalent: BunHttpClient and DenoHttpClient only re-export FetchHttpClient. Both runtimes can do the same things, but only through fetch fields that aren't in the standard RequestInit:

  • Bun: fetch(url, { unix, tls: { ca, cert, key, rejectUnauthorized, serverName } })
  • Deno: fetch(url, { client }), where the client comes from Deno.createHttpClient({ caCerts, cert, key, proxy: { transport: "unix", path } }) and has to be closed afterwards.

You can get there by providing FetchHttpClient.RequestInit or a custom Fetch, but it isn't documented, and the types don't fit. Effect's own Kubernetes integration, which only needs to trust one CA file, does it three different ways:

  • Node: an undici Agent (packages/platform/node/src/NodeClusterSocket.ts:150-174).
  • Bun: { tls: { ca } } as any (packages/platform/bun/src/BunClusterSocket.ts:156-160).
  • Deno: a wrapped fetch that injects client with as any and closes it when the scope ends (packages/platform/deno/src/DenoClusterSocket.ts:197-201).

Anyone who needs the Docker socket on Bun, or a client certificate on Deno, has to rediscover all of this.

Proposal

One layer per runtime that takes that runtime's own options, the same way the Node layers take undici's options:

BunHttpClient.layerOptions({ unix: "/var/run/docker.sock" })
BunHttpClient.layerOptions({ tls: { ca, cert, key } })

DenoHttpClient.layerOptions({ proxy: { transport: "unix", path: "/var/run/docker.sock" } })
DenoHttpClient.layerOptions({ caCerts: [ca], cert, key })
  • Bun passes the options into every fetch call.
  • Deno creates the Deno.HttpClient in the layer's scope and closes it when the scope ends.
  • The JSDoc for each layer says what is supported. For example, Deno has no option to skip certificate verification or to set the server name.

Then switch the Bun and Deno Kubernetes layers over and remove the casts.

Why in Effect

HttpClient is meant to be portable, yet on two of the three server runtimes these settings are only reachable through untyped, undocumented fields. This is the Node change from #9158 applied to Bun and Deno, with no new concepts.

Scope

In scope:

  • layerOptions for Bun and Deno, with docs.
  • Using them in the Kubernetes layers.

Out of scope:

  • A connection or TLS type shared by all runtimes.
  • http+unix:// URLs, which have no standard scheme.
  • Per-request connection settings.
Lenguaje dominante
TypeScript
Estrellas
16.7k
Forks
808
Merge medio
11 h 24 min
PR fusionados (30 d)
848

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Effect-TS/effect

Todos los issues de Effect-TS/effect

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.