QUIC protocol erlang library.
msquic NIF binding.
Project Status: WIP (actively), POC quality
API: is not stable, might be changed in the future.
OS | Status |
---|---|
Linux | Supported |
macOS | Supported |
Windows | TBD |
- OTP22+
- rebar3
- cmake3.16+
- CLOG (required for debug logging only)
- LTTNG2.12 (required for debug build only)
Debug build dependency: CLOG
$ rebar3 compile
# OR
$ make
note,
To enable logging and release build:
export CMAKE_BUILD_TYPE=Debug
export QUIC_ENABLE_LOGGING=ON
export QUICER_USE_LTTNG=1
make
QUIC_LOGGING_TYPE=stdout make
export CMAKE_BUILD_TYPE=Release
make
application:ensure_all_started(quicer),
Port = 4567,
LOptions = [ {certfile, "cert.pem"}
, {keyfile, "key.pem"}
, {alpn, ["sample"]}
, {peer_bidi_stream_count, 1}
],
{ok, L} = quicer:listen(Port, LOptions),
{ok, Conn} = quicer:accept(L, [], 120000),
{ok, Conn} = quicer:handshake(Conn),
{ok, Stm} = quicer:accept_stream(Conn, []),
receive {quic, <<"ping">>, Stm, _Props} -> ok end,
{ok, 4} = quicer:send(Stm, <<"pong">>),
quicer:close_listener(L).
application:ensure_all_started(quicer),
Port = 4567,
{ok, Conn} = quicer:connect("localhost", Port, [{alpn, ["sample"]}, {verify, none}], 5000),
{ok, Stm} = quicer:start_stream(Conn, []),
{ok, 4} = quicer:send(Stm, <<"ping">>),
receive {quic, <<"pong">>, Stm, _Props} -> ok end,
ok = quicer:close_connection(Conn).
$ make test
$ make doc
Then check the doc in browser:
$ firefox doc/index.html
Apache License Version 2.0