From 8bf7a6dcc7b08a25b8638fae1c9656f84cb2a495 Mon Sep 17 00:00:00 2001 From: Andy Gayton Date: Mon, 20 Oct 2025 18:55:22 +0000 Subject: [PATCH 1/2] . --- cookbook/http.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/cookbook/http.md b/cookbook/http.md index df671aaec1b..5877d64408d 100644 --- a/cookbook/http.md +++ b/cookbook/http.md @@ -292,3 +292,19 @@ Available metadata: - `status` - HTTP status code (200, 404, 500, etc.) - `headers` - `[{name, value}, ...]` - `urls` - Redirect history + +--- + +### Connecting via Unix Domain Sockets + +On Unix systems, you can connect to HTTP servers over Unix domain sockets using the `--unix-socket` flag. This is commonly used for local services like the Docker daemon, systemd, or other IPC services. + +```nu +# Query Docker daemon via Unix socket +http get --unix-socket /var/run/docker.sock http://localhost/containers/json + +# The hostname in the URL populates the HTTP Host header +http post --unix-socket ./my-service.sock http://api/endpoint {data: "value"} +``` + +The socket path specifies where to connect, while the URL's hostname is used for the HTTP Host header. From 510a67e526f1bed20a9ab5b5b1ed6d8e5c722bb6 Mon Sep 17 00:00:00 2001 From: Andy Gayton Date: Tue, 21 Oct 2025 17:39:50 +0000 Subject: [PATCH 2/2] . --- cookbook/http.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/http.md b/cookbook/http.md index 5877d64408d..fbdf144a687 100644 --- a/cookbook/http.md +++ b/cookbook/http.md @@ -297,7 +297,7 @@ Available metadata: ### Connecting via Unix Domain Sockets -On Unix systems, you can connect to HTTP servers over Unix domain sockets using the `--unix-socket` flag. This is commonly used for local services like the Docker daemon, systemd, or other IPC services. +You can connect to HTTP servers over Unix domain sockets using the `--unix-socket` flag. This works on Unix/Linux systems and Windows 10+ (build 17063 and later). This is commonly used for local services like the Docker daemon, systemd, or other IPC services. ```nu # Query Docker daemon via Unix socket