Quichex

Quichex exposes the cloudflare/quiche QUIC implementation to Elixir via Rustler. The public API currently lives under Quichex.Native, providing direct access to connection/configuration/packet helpers. Most calls return {:ok, term} / {:error, reason} tuples, while config setters return the config reference and raise Quichex.Native.ConfigError on failure.

Capabilities

Example Workflow

alias Quichex.Native.TestHelpers

{_, client} = TestHelpers.create_connection()
{_, server} = TestHelpers.accept_connection()

:ok = TestHelpers.ok!(Quichex.Native.connection_stream_send(client, 0, "hi", true))

HTTP/3 Example

alias Quichex.H3

# assumes `conn` is an established QUIC connection
h3_config = H3.config_new()
h3_conn = H3.conn_new_with_transport(conn, h3_config)

stream_id =
  H3.send_request(conn, h3_conn, [
    {":method", "GET"},
    {":scheme", "https"},
    {":authority", "localhost"},
    {":path", "/"}
  ], true)

_ = H3.conn_poll(conn, h3_conn)

WebTransport Example

alias Quichex.WebTransport

# assumes `conn` + `h3_conn` are ready for HTTP/3
stream_id = WebTransport.connect(conn, h3_conn, "localhost", "/moq")
WebTransport.send_datagram(conn, stream_id, "ping")

Testing

All tests can be run with:

mix test

External HTTP/3 integration tests can be run with:

QUICHEX_INTEGRATION=1 mix test test/quichex/h3_integration_test.exs

The suite exercises:

Refer to test/quichex/native/connection_test.exs for examples showing how to create configs, accept connections, and pump packets between peers entirely from Elixir.