Skip to content

TB142/quic

This branch is 438 commits behind emqx/quic:main.

Folders and files

NameName
Last commit message
Last commit date
Feb 23, 2023
Feb 24, 2021
Mar 5, 2023
Jan 3, 2023
Feb 3, 2023
Feb 24, 2021
Jan 24, 2023
Mar 6, 2023
Jun 6, 2022
May 11, 2021
Jun 15, 2022
Apr 8, 2022
Sep 29, 2022
May 10, 2022
Oct 19, 2022
Jan 27, 2020
Jan 23, 2023
Feb 3, 2023
Jun 17, 2022
Apr 25, 2022
Dec 27, 2021
Jun 15, 2022
Jan 23, 2023
Aug 25, 2022

Repository files navigation

quicer

QUIC protocol erlang library.

msquic NIF binding.

Project Status: WIP (actively), POC quality

API: is not stable, might be changed in the future.

Erlang CI License Coverage Status

OS Support

OS Status
Linux Supported
MACOS Supported
Windows TBD

BUILD

Dependencies

  1. OTP22+
  2. rebar3
  3. cmake3.16+
  4. CLOG (required for debug logging only)
  5. LTTNG2.12 (required for debug build only)

With DEBUG

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

Without DEBUG

export CMAKE_BUILD_TYPE=Release
make

Examples

Ping Pong server and client

Server

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).

Client

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).

TEST

$ make test

Documentation

$ make doc

Then check the doc in browser:

$ firefox doc/index.html

License

Apache License Version 2.0

About

QUIC protocol for Erlang & Elixir

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Erlang 59.9%
  • C 38.4%
  • Other 1.7%