Hackney 4.1.0 - WebTransport client

hackney 4.1.0 adds a WebTransport client. It mirrors the existing WebSocket
client, so moving from WebSocket to WebTransport is a matter of swapping the
ws_ prefix for wt_:

{ok, Conn} = hackney:wt_connect(<<"https://example.com/wt">>),
ok = hackney:wt_send(Conn, {binary, <<"hello">>}),
{ok, {binary, <<"hello">>}} = hackney:wt_recv(Conn),
hackney:wt_close(Conn).

It runs over HTTP/3 (QUIC) by default, with HTTP/2 as an option. A session is
the analog of an HTTP/2 connection: one session multiplexes many bidirectional
or unidirectional streams (wt_open_stream/2, wt_stream_send/3,4,
wt_stream_recv/2,3) plus unreliable datagrams (wt_send_datagram/2). There is
no custom wire framing, so it interoperates with any WebTransport server. The
guide documents both the client and a server handler.

This is a drop-in addition, no breaking changes from 4.0.x.

{hackney, "4.1.0"}      %% rebar
{:hackney, "~> 4.1"}    # mix

WebTransport Guide:

Changelog: hackney/NEWS.md at master · benoitc/hackney · GitHub
Release: Release hackney 4.1.0 · benoitc/hackney · GitHub
Hex: hackney | Hex

3 Likes