--- id: requests-unixsocket version: "0.4.1" license: unclear license_treatment: unclear maintenance: active --- # requests-unixsocket — Use requests to talk HTTP via a UNIX domain socket License: unclear · Maintenance: active · Downloads: 2.9M/mo ## What it is and what it does requests-unixsocket is a thin adapter that teaches the requests library to speak HTTP over UNIX domain sockets instead of TCP. It works by registering a custom transport adapter that intercepts http+unix:// URLs and routes them through a local socket connection. The package is primarily used to interact with services that expose APIs only via socket files—most commonly Docker's daemon socket, but also other containerization and system management tools that follow this pattern. You can use it two ways: by instantiating a special Session object and calling methods on it, or by monkeypatching the requests module globally (or within a context manager) to make standard requests.get() calls work with socket URLs. The package supports both standard UNIX sockets and Linux abstract namespace sockets, and it requires only requests as a runtime dependency. Use it for: - Query Docker daemon API by connecting to /var/run/docker.sock without spawning a subprocess - Communicate with systemd user services or other system daemons that expose HTTP APIs via socket files - Build container orchestration tools that need direct socket-level access to container runtimes - Test HTTP services running locally that only listen on UNIX sockets in development environments - Interact with Kubernetes kubelet or other Kubernetes components via their socket endpoints ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Extends the requests library to make HTTP calls over UNIX domain sockets instead of TCP, enabling communication with local socket-based services like Docker. Yes, if you need to make HTTP requests to services listening on UNIX domain sockets. The package is lightweight, actively maintained, has no known vulnerabilities, and integrates seamlessly with the familiar requests API. The main caveat is that license treatment is unclear in the metadata, so verify the actual license in the repository before use in proprietary code. ## Install pip install requests-unixsocket uv add requests-unixsocket poetry add requests-unixsocket ## Installing requests-unixsocket Before you install: Low friction install with a single runtime dependency on requests. The package is actively maintained with recent commits and has been stable since its early releases. Quickstart: import requests_unixsocket session = requests_unixsocket.Session() r = session.get('http+unix://%2Fvar%2Frun%2Fdocker.sock/info') print(r.json()) Requires Python 3.9 or later. UNIX domain socket support is OS-dependent; abstract namespace sockets are Linux-only. Verify before relying: - Whether the package handles connection pooling and performance characteristics for high-volume socket communication - Support status for Windows named pipes or other non-UNIX socket transports ## Package facts - License: not declared (unclear) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 2.9M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags unix domain socket http client, requests over unix socket, docker socket communication, local socket http requests, unix socket adapter requests, http via unix domain socket, unix-socket, docker-client, http-adapter [View on SkillFed](https://skillfed.io/packages/requests-unixsocket) · [View on PyPI](https://pypi.org/project/requests-unixsocket/)