I’d like to add a supported way to select a Unix-domain socket for an individual httpc:request/4,5 call without changing profile configuration.
Today, httpc supports Unix sockets through an experimental profile-level option. A library that needs to contact local daemons must manage dedicated profiles or change shared profile settings. Changing shared settings races with concurrent requests; dedicated profiles introduce a lifecycle the library must manage. This is blocking Unix-socket support in the Gleam httpc bindings.
My preference is a request-level {unix_socket, Path} option that selects the local transport for that request:
httpc:request(
get,
{"http://localhost/v1.49/containers/json", []},
[],
[{unix_socket, "/var/run/docker.sock"}]
).
The URL would continue to identify the HTTP resource; the option would select the connection endpoint. Calls without the option would retain their existing behavior.