{"id":18383769,"url":"https://github.com/elixir-mint/hpax","last_synced_at":"2025-04-06T23:32:36.524Z","repository":{"id":40723579,"uuid":"408339062","full_name":"elixir-mint/hpax","owner":"elixir-mint","description":"Implementation of the HPACK protocol for Elixir. 🎴","archived":false,"fork":false,"pushed_at":"2024-05-29T06:31:00.000Z","size":45,"stargazers_count":19,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-05-29T19:18:00.461Z","etag":null,"topics":["elixir","elixir-lang","hpack","http","http2"],"latest_commit_sha":null,"homepage":"https://datatracker.ietf.org/doc/html/rfc7541","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elixir-mint.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-20T06:52:14.000Z","updated_at":"2024-06-13T09:59:05.692Z","dependencies_parsed_at":"2024-05-29T07:57:11.351Z","dependency_job_id":"0d977b2b-b706-4394-b009-0d5b478578c7","html_url":"https://github.com/elixir-mint/hpax","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-mint%2Fhpax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-mint%2Fhpax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-mint%2Fhpax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-mint%2Fhpax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elixir-mint","download_url":"https://codeload.github.com/elixir-mint/hpax/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247569128,"owners_count":20959758,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["elixir","elixir-lang","hpack","http","http2"],"created_at":"2024-11-06T01:12:27.138Z","updated_at":"2025-04-06T23:32:33.134Z","avatar_url":"https://github.com/elixir-mint.png","language":"Elixir","readme":"# HPAX\n\n![CI](https://github.com/elixir-mint/hpax/actions/workflows/main.yml/badge.svg)\n[![Docs](https://img.shields.io/badge/api-docs-green.svg?style=flat)](https://hexdocs.pm/hpax)\n[![Hex.pm Version](http://img.shields.io/hexpm/v/hpax.svg?style=flat)](https://hex.pm/packages/hpax)\n[![Coverage Status](https://coveralls.io/repos/github/elixir-mint/hpax/badge.svg?branch=main)](https://coveralls.io/github/elixir-mint/hpax?branch=main)\n\nHPAX is an Elixir implementation of the HPACK header compression algorithm as used in HTTP/2 and\ndefined in RFC 7541. HPAX is used by several Elixir projects, including the\n[Mint](https://github.com/elixir-mint/mint) HTTP client and\n[bandit](https://github.com/mtrudel/bandit) HTTP server projects.\n\n## Installation\n\nTo install HPAX, add it to your `mix.exs` file.\n\n```elixir\ndefp deps do\n  [\n    {:hpax, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\nThen, run `$ mix deps.get`.\n\n## Usage\n\nHPAX is designed to be used in both encoding and decoding scenarios. In both cases, a context is\nused to maintain state internal to the HPACK algorithm. In the common use case of using HPAX\nwithin HTTP/2, this context is called a **table** and must be shared between any\nsubsequent encoding/decoding calls within\nan endpoint. Note that the contexts used for encoding and decoding within HTTP/2 are completely\ndistinct from one another, even though they are structurally identical.\n\nTo encode a set of headers into a binary with HPAX:\n\n```elixir\ncontext = HPAX.new(4096)\nheaders = [{:store, \":status\", \"201\"}, {:store, \"location\", \"http://example.com\"}]\n{encoded_headers, context} = HPAX.encode(headers, context)\n#=\u003e {iodata, updated_context}\n```\n\nTo decode a binary into a set of headers with HPAX:\n\n```elixir\ncontext = HPAX.new(4096)\nencoded_headers = \u003c\u003c...\u003e\u003e\n{:ok, headers, context} = HPAX.decode(encoded_headers, context)\n#=\u003e {:ok, [{:store, \":status\", \"201\"}, {:store, \"location\", \"http://example.com\"}], updated_context}\n```\n\nFor complete usage information, please see the HPAX [documentation](https://hex.pm/packages/hpax).\n\n## Contributing\n\nIf you wish to contribute check out the [issue list](https://github.com/elixir-mint/hpax/issues) and let us know what you want to work on so we can discuss it and reduce duplicate work.\n\n## License\n\nCopyright 2021 Eric Meadows-Jönsson and Andrea Leopardi\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felixir-mint%2Fhpax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felixir-mint%2Fhpax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felixir-mint%2Fhpax/lists"}