talira

An HTTP client for Erlang. Simple, reliable, fast.

open sourceApache-2.0free

hackney is an HTTP client for Erlang, used from Elixir and Gleam too through Hex. Each connection runs in its own process, so a crash cleans up after itself, and connections are pooled per host or globally. It negotiates HTTP/2 by ALPN with multiplexing and flow control, has experimental HTTP/3 over QUIC in pure Erlang, streams request and response bodies, delivers responses asynchronously as messages, and includes WebSocket and WebTransport clients and full-duplex HTTP/2 streams for gRPC-style use. It verifies TLS certificates by default against Mozilla's CA bundle, tries IPv6 first with Happy Eyeballs and decompresses gzip and deflate responses.

Problems it solves

  • make HTTP requests from my Erlang or Elixir application with connection pooling
  • stream a large file download in Erlang without loading it all into memory
  • call an HTTP/2 or gRPC-style streaming API from the BEAM
  • open a WebSocket connection from an Erlang client

Features

  • HTTP/1.1 and HTTP/2 with ALPN negotiation
  • experimental HTTP/3 over QUIC in pure Erlang
  • one process per connection
  • connection pooling per host or globally
  • streaming request and response bodies
  • asynchronous responses as messages
  • WebSocket and WebTransport clients
  • TLS certificate verification by default
  • Happy Eyeballs, IPv6 first
  • automatic gzip and deflate decompression

Capabilities

Has official SDKsplan not known

Alternatives

The same job

These do what hackney does.

  1. HTTPoison Yet another HTTP client for Elixir, powered by hackney
  2. Tesla The flexible HTTP client library for Elixir, with middleware and multiple adapters

Compare hackney with the top 3