Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions cookbook/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

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
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.