Typed unix socket and TLS options for `BunHttpClient` and `DenoHttpClient`
Los mantenedores suelen responder en 1 día
Evaluación
Este issue todavía no se ha evaluado.
Descripción
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 fromDeno.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
fetchthat injectsclientwithas anyand 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.HttpClientin 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:
layerOptionsfor 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
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Effect-TS/effect
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
AI providers: tool results cannot carry images because non-string results are JSON.stringify'dPosiblemente ocupada @nmnmcc la tomó hoy. Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Effect-TS/effect#9857 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
Los mantenedores suelen responder en 1 día
-
`Schema.Literals`: add `omit`, the complement of `pick`Posiblemente ocupada @effect-bot la tomó hace 1 día. Abiertoenhancement Needs Evaluation
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
Support the `openapi-3.0` target in `Schema.toStandardJSONSchemaV1`Posiblemente ocupada @MichaelDeBoey la tomó hace 1 día. Abiertoenhancement Needs Evaluation
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Effect-TS/effect#9764 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de Effect-TS/effect
Issues similares
-
area: image-engine bug priority: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
snapotter-hq/SnapOtter#3885 ·
Los mantenedores suelen responder en 1 día
-
Mend: dependency security vulnerability
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 3 días
-
pending triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
bug P3 UI/UX
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
openclaw/openclaw#182077 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día