Enable UDS support for Isahc backend
- Dominant language
- Rust
- Stars
- 1.5k
- Forks
- 128
- PR merge metrics
- No merged PRs in 30d
Description
:wave: I'm looking to use surf to communicate with a unix domain socket (and maybe a windows named pipe someday but not anytime soon).
I figured this would work "out of the box" since the default client seems to be based on libcurl, and libcurl can handle unix sockets. However to my dismay this seems to not work:
```rust
surf::get("unix://var/run/docker.sock:0/v1.30/version")
```
Specifically it fails with logs like:
```
Jan 08 00:30:28.069 DEBUG clean:docker_api_get{path="/version" timeout=None}: dev_loop::executors::docker: URL for get will be: unix://var/run/docker.sock:0/v1.30/version
Jan 08 00:30:28.069 DEBUG clean:docker_api_get{path="/version" timeout=None}: isahc::agent: agent waker listening on 127.0.0.1:48125
Jan 08 00:30:28.070 DEBUG isahc::agent: agent took 924.736µs to start up
Jan 08 00:30:28.070 DEBUG isahc::agent: agent ready
Jan 08 00:30:28.070 INFO clean:docker_api_get{path="/version" timeout=None}: surf::middleware::logger::native: sending request
Jan 08 00:30:28.070 DEBUG isahc::handler: initializing handler for request [id=0]
Jan 08 00:30:28.070 DEBUG isahc::curl: Protocol "unix" not supported or disabled in libcurl
Jan 08 00:30:28.070 DEBUG isahc::curl: Closing connection -1
Jan 08 00:30:28.070 DEBUG isahc::handler: curl error: [1] Unsupported protocol
Jan 08 00:30:28.070 WARN isahc::handler: request completed with error [id=AtomicCell { value: 0 }]: Curl("Unsupported protocol"): Unsupported protocol
Jan 08 00:30:28.071 DEBUG isahc::agent: agent shutting down
Jan 08 00:30:28.071 WARN clean: dev_loop::executors::docker: Failed to reach out to docker engine api: [Failed to send docker API Request due to: [Curl("Unsupported protocol")]]
```
Is there a known way to get this to work currently?
Contributor guide
Assessment
This issue has not been assessed yet.