{"id":32196848,"url":"https://github.com/into-docker/unixsocket-http","last_synced_at":"2026-02-19T08:34:57.579Z","repository":{"id":45031544,"uuid":"254405271","full_name":"into-docker/unixsocket-http","owner":"into-docker","description":"A Clojure library to handle HTTP communication over UNIX domain (and TCP) sockets","archived":false,"fork":false,"pushed_at":"2023-10-09T08:44:00.000Z","size":144,"stargazers_count":20,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-25T23:34:26.288Z","etag":null,"topics":["clj-http","clojure","clojure-library","unix-domain-sockets"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/into-docker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-09T15:12:25.000Z","updated_at":"2024-07-11T21:55:53.000Z","dependencies_parsed_at":"2022-07-26T08:32:01.517Z","dependency_job_id":null,"html_url":"https://github.com/into-docker/unixsocket-http","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/into-docker/unixsocket-http","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/into-docker%2Funixsocket-http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/into-docker%2Funixsocket-http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/into-docker%2Funixsocket-http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/into-docker%2Funixsocket-http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/into-docker","download_url":"https://codeload.github.com/into-docker/unixsocket-http/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/into-docker%2Funixsocket-http/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29608562,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T06:47:36.664Z","status":"ssl_error","status_checked_at":"2026-02-19T06:45:47.551Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clj-http","clojure","clojure-library","unix-domain-sockets"],"created_at":"2025-10-22T02:44:03.885Z","updated_at":"2026-02-19T08:34:57.574Z","avatar_url":"https://github.com/into-docker.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# unixsocket-http\n\n[![Clojars Project](https://img.shields.io/clojars/v/unixsocket-http.svg)](https://clojars.org/unixsocket-http)\n[![Documentation](https://cljdoc.org/badge/unixsocket-http/unixsocket-http)](https://cljdoc.org/d/unixsocket-http/unixsocket-http/CURRENT)\n[![CI](https://github.com/into-docker/unixsocket-http/workflows/CI/badge.svg)](https://github.com/into-docker/unixsocket-http/actions?query=workflow%3ACI)\n[![codecov](https://codecov.io/gh/into-docker/unixsocket-http/branch/master/graph/badge.svg?token=GLSK1G95TX)](https://codecov.io/gh/into-docker/unixsocket-http)\n[![Compatible with GraalVM](https://img.shields.io/badge/graalvm-compatible-success)](https://www.graalvm.org/docs/reference-manual/native-image)\n\n**unixsocket-http** is a Clojure library to handle HTTP communication over\nUNIX domain sockets. This kind of I/O is notably used by the [Docker][docker]\ndaemon which was the main driver to create this library.\n\n[docker]: https://www.docker.com/\n\n## Usage\n\nUse the `unixsocket-http.core` namespace to access HTTP functionality with\na similar API as [clj-http][].\n\n```clojure\n(require '[unixsocket-http.core :as uhttp])\n(def client (uhttp/client \"unix:///var/run/docker.sock\"))\n```\n\nTo provide a common API towards TCP sockets, they are also supported:\n\n```clojure\n(def client (uhttp/client \"tcp://127.0.0.1:6537\"))\n```\n\nNote that this project does not have the ambition to replicate all of clj-http's\nfunctionality. The main use case is communication with Docker which will\nnaturally restrict the feature set implemented.\n\n[clj-http]: https://github.com/dakrone/clj-http\n\nOnce you have a client, you can send requests:\n\n```clojure\n(uhttp/get client \"/_ping\")\n;; {:status 200,\n;;  :headers\n;;  {\"api-version\" \"1.40\",\n;;   \"server\" \"Docker/19.03.2 (linux)\",\n;;   \"content-type\" \"text/plain; charset=utf-8\",\n;;   \"content-length\" \"2\",\n;;   \"docker-experimental\" \"false\",\n;;   \"pragma\" \"no-cache\",\n;;   \"date\" \"Thu, 09 Apr 2020 15:20:06 GMT\",\n;;   \"ostype\" \"linux\",\n;;   \"cache-control\" \"no-cache, no-store, must-revalidate\"},\n;;  :body \"OK\"}\n```\n\nAll HTTP functions take an options map as their last parameter that can be used\nto supply additional data or alter the request/response behaviour.\n\n### Query Parameters \u0026 Body\n\nQuery parameters can be passed using `:query-params`, and a body can be\nsupplied as either `InputStream` or `String` using the `:body` key.\n\n```clojure\n(uhttp/post\n  client\n  \"/images/create\"\n  {:query-params {:fromImage \"node:alpine\", :repo \"testnode\", :tag \"latest\"}})\n;; {:status 200,\n;;  :headers\n;;  {\"api-version\" \"1.40\",\n;;   \"content-type\" \"application/json\",\n;;   \"date\" \"Thu, 09 Apr 2020 15:27:11 GMT\",\n;;   \"docker-experimental\" \"false\",\n;;   \"ostype\" \"linux\",\n;;   \"server\" \"Docker/19.03.2 (linux)\",\n;;   \"transfer-encoding\" \"chunked\"},\n;;  :body\n;;  \"{\\\"status\\\":\\\"Pulling from library/node\\\",\\\"id\\\":\\\"latest\\\"}\\r\\n...\"}\n```\n\nAs this is supported by some APIs, you can pass a query parameter multiple times\nby supplying a collection instead of value. For example, `{:x [1 2 3]}` turns\ninto `?x=1\u0026x=2\u0026x=3`.\n\n### Streaming Responses\n\nUse `:as :stream` in the options map to make `:body` an `java.io.InputStream` to\nconsume from. Alternatively, use `:as :socket` to get access to the underlying\n`java.net.Socket` for bidirectional communication.\n\nAlways make sure to call `close` on the resources obtained this way, otherwise\nyou'll run into connection leaks.\n\n### Exceptions\n\nBy default, HTTP status codes ≥ 400 will cause an exception\n(`clojure.lang.ExceptionInfo`) to be thrown. You can access the underlying\nresponse via `ex-data`.\n\nNote that the `:body` will not be present if you are expecting a streaming\nresponse, unless you explicitly set `:throw-entire-message?` to `true`.\n\nIf you want to prevent the client from throwing exceptions, and you'd rather get\nthe response no matter what, you can set `:throw-exceptions?` to `false`.\n\n### TLS\n\nYou can create a client with an `https://...` URL, which will prompt it to use\nTLS to perform any requests. Usually, the relevant certificates should be\npresent in your Java keystore and the underlying `OkHttpClient` will pick them\nup automatically when verifying the connection.\n\nFor _mutual_ TLS (mTLS) or pointers on how to tackle TLS setup manually, check\nout the [respective documentation](./doc/01-mTLS.md).\n\n## GraalVM\n\nThis library can be used with GraalVM's [`native-image`][native-image] tool to\ncreate native Clojure executables. The necessary configuration files are already\nbundled with this library and should be picked up automatically.\n\n[native-image]: https://www.graalvm.org/docs/reference-manual/native-image/\n\n## License\n\n```\nMIT License\n\nCopyright (c) 2020-2021 Yannick Scherer\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finto-docker%2Funixsocket-http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finto-docker%2Funixsocket-http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finto-docker%2Funixsocket-http/lists"}