HTTPUnixSocketConnection
Really small Python class that extends native http.client.HTTPConnection allowing sending HTTP requests to Unix Sockets
Installation
Poetry
poetry add httpunixsocketconnection
pip
pip install httpunixsocketconnection
Usage
Because the class base is http.client.HTTPConnection, the API is almost the same.
Only the constructor and connect method is different.
With the rest please follow the official docs.
from httpunixsocketconnection import HTTPUnixSocketConnection
# Create a connection
conn = HTTPUnixSocketConnection(
unix_socket="/var/run/some.unix.socket"
# timeout=Like in HTTPConnection
# blocksize=Like in HTTPConnection
)
Example: Getting list of Docker Containers
from httpunixsocketconnection import HTTPUnixSocketConnection
conn = HTTPUnixSocketConnection("/var/run/docker.sock")
conn.request("GET", "/containers/json")
res = conn.getresponse()
print(res.status, res.reason)
content = res.read().decode("utf-8")
print(content)
Metadata
Release files for httpunixsocketconnection 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| httpunixsocketconnection-1.0.1.tar.gz | 6.2 kB | Without provenance | Details for httpunixsocketconnection-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| httpunixsocketconnection-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for httpunixsocketconnection-1.0.1-py3-none-any.whl |
Total release size: 12.8 kB
Release files / httpunixsocketconnection-1.0.1.tar.gz
| Download URL | httpunixsocketconnection-1.0.1.tar.gz |
|---|---|
| Size | 6.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6523c806593c2f8586343c06f372d8b21a913cfe1def9e94b24c5b22cc00e7c7
|
|
BLAKE2b-256 checksum How to use checksums |
81baf1d84343445ba123483f61153baa00cbe8fbe4881807c6c70d1a3e1e7dff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.8.10 Linux/5.14.0-1027-oem
|
Release files / httpunixsocketconnection-1.0.1-py3-none-any.whl
| Download URL | httpunixsocketconnection-1.0.1-py3-none-any.whl |
|---|---|
| Size | 6.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3e8ea3063296951f6c7767552b69837f6be22bb19ba29a7c4ede911e2ff00b7c
|
|
BLAKE2b-256 checksum How to use checksums |
1ff000b795e8c42502de45a30809154877fe594b500bb711584944366003cb45
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.8.10 Linux/5.14.0-1027-oem
|
Security for httpunixsocketconnection 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.