Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#9,687 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@effect-bot ci sta già lavorando.

Dal 21/10/2026.

  • #9704 di @tim-smart — aperta

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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.
Lingua principale
TypeScript
Stelle
16.7k
Fork
808
Merge medio
10h 7m
PR unite (30g)
808

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Effect-TS/effect

Tutte le issue di Effect-TS/effect

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.