XQUIC Library released by Alibaba is a cross-platform implementation of QUIC and HTTP/3 protocol.

Overview

XQUIC

xquic logo

GitHub Build CodeQL Codacy Badge Codacy Badge Platforms

简体中文文档 README-zh-CN

Introduction

XQUIC Library released by Alibaba is …

a client and server implementation of QUIC and HTTP/3 as specified by the IETF. Currently supported QUIC versions are v1 and draft-29.

OS and platform agnostic. It currently supports Android, iOS, Linux, macOS and Windows. Most of the code is used in our own products, and has been tested at scale on android, iOS apps, as well as servers.

still in active development. Interoperability is regularly tested with other QUIC implementations.

Requirements

To build XQUIC, you need

  • CMake
  • BoringSSL or BabaSSL

To run test cases, you need

  • libevent
  • CUnit

QuickStart Guide

XQUIC supports both BabaSSL and BoringSSL.

Build with BoringSSL

# get XQUIC source code
git clone [email protected]:alibaba/xquic.git
cd xquic

# get and build BoringSSL
git clone [email protected]:google/boringssl.git ./third_party/boringssl
cd ./third_party/boringssl
mkdir -p build && cd build
cmake -DBUILD_SHARED_LIBS=0 -DCMAKE_C_FLAGS="-fPIC" -DCMAKE_CXX_FLAGS="-fPIC" ..
make ssl crypto
cd ..
SSL_TYPE_STR="boringssl"
SSL_PATH_STR="${PWD}"
SSL_INC_PATH_STR="${PWD}/include"
SSL_LIB_PATH_STR="${PWD}/build/ssl/libssl.a;${PWD}/build/crypto/libcrypto.a"
cd ../..

# build XQUIC with BoringSSL
git submodule update --init --recursive
mkdir -p build; cd build
cmake -DGCOV=on -DCMAKE_BUILD_TYPE=Debug -DXQC_ENABLE_TESTING=1 -DXQC_SUPPORT_SENDMMSG_BUILD=1 -DXQC_ENABLE_EVENT_LOG=1 -DXQC_ENABLE_BBR2=1 -DXQC_DISABLE_RENO=0 -DSSL_TYPE=${SSL_TYPE_STR} -DSSL_PATH=${SSL_PATH_STR} -DSSL_INC_PATH=${SSL_INC_PATH_STR} -DSSL_LIB_PATH=${SSL_LIB_PATH_STR} ..
make -j

Build with BabaSSL

# get XQUIC source code
git clone [email protected]:alibaba/xquic.git
cd xquic

# get and build BabaSSL
git clone [email protected]:BabaSSL/BabaSSL.git ./third_party/babassl
cd ./third_party/babassl/
./config --prefix=/usr/local/babassl
make -j
SSL_TYPE_STR="babassl"
SSL_PATH_STR="${PWD}"
SSL_INC_PATH_STR="${PWD}/include"
SSL_LIB_PATH_STR="${PWD}/libssl.a;${PWD}/libcrypto.a"
cd -

# build XQUIC with BabaSSL
git submodule update --init --recursive
mkdir -p build; cd build
cmake -DGCOV=on -DCMAKE_BUILD_TYPE=Debug -DXQC_ENABLE_TESTING=1 -DXQC_SUPPORT_SENDMMSG_BUILD=1 -DXQC_ENABLE_EVENT_LOG=1 -DXQC_ENABLE_BBR2=1 -DXQC_DISABLE_RENO=0 -DSSL_TYPE=${SSL_TYPE_STR} -DSSL_PATH=${SSL_PATH_STR} -DSSL_INC_PATH=${SSL_INC_PATH_STR} -DSSL_LIB_PATH=${SSL_LIB_PATH_STR} ..
make -j

Run testcases

sh ../scripts/xquic_test.sh

Documentation

Contributing

We would love for you to contribute to XQUIC and help make it even better than it is today! All types of contributions are encouraged and valued. Thanks to all contributors. See our Contributing Guidelines for more information.

If you have any questions, please feel free to open a new Discussion topic in our discussion forums.

License

XQUIC is released under the Apache 2.0 License.

Contact Us

Feel free to contact us in the following ways:

  • e-mail: [email protected]

  • Dingtalk group: 34059705

  • slack channel: #xquic in quicdev group

    dingtalk group
Issues
  • [Bug]: Division-by-zero exception caused by return value of xqc_pacing_rate_calc()

    [Bug]: Division-by-zero exception caused by return value of xqc_pacing_rate_calc()

    What happened?

    Function xqc_pacing_rate_calc() can returned 0 in some case (I encountered this problem once, not sure how to reproduce), and causing division-by-zero exception in xqc_pacing_time_until_send() at this line: https://github.com/alibaba/xquic/blob/7f362ee085a4a1eeb48fb7f90a3ae07f24481872/src/transport/xqc_pacing.c#L122

    Steps To Reproduce

    I encountered this problem once, not sure how to reproduce.

    Relevant log output

    No response

    :lady_beetle: bug 
    opened by Saigut 8
  • [Bug]: build error

    [Bug]: build error

    What happened?

    Build error happens when I run "make -j"

    Steps To Reproduce

    Follow the README

    Relevant log output

    ld: unknown option: --whole-archive
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make[2]: *** [libxquic.dylib] Error 1
    make[1]: *** [CMakeFiles/xquic.dir/all] Error 2
    make[1]: *** Waiting for unfinished jobs....
    [ 90%] Built target xquic-static
    make: *** [all] Error 2
    
    opened by trip-ibu 8
  • [Bug]: send stream packet 1Mbps get drop rate, the stream is unreliability and unstability

    [Bug]: send stream packet 1Mbps get drop rate, the stream is unreliability and unstability

    What happened?

    1 Forward or schedule packet to xquic, send stream packet use function bellow void client_network_send(void *out_data, size_t out_dlen) { g_user_stream->send_body = out_data; g_user_stream->send_body_len = out_dlen; g_user_stream->send_offset = 0; client_stream_send(g_user_stream->stream, g_user_stream); }

    2 Send iperf udp packet in limited bandwidth and get the packet lost

    iperf -u -c 10.7.0.1 -b 1M -t 10 -p 6001 // drop rate 20% iperf -u -c 10.7.0.1 -b 2M -t 10 -p 6001 // drop rate 50%

    image

    3 The stream transport is unreliability and unstability 3.1 server stream segmentation fault image

    3.2 server close stream actively image

    3.3 client stream segmentation fault 1650855941(1)

    Steps To Reproduce

    1 Forward or schedule packet to xquic 2 send packet with function client_network_send( ) 3 use iperf test tool to detect the udp throughput 4 get some drop rate and unstability

    Relevant log output

    No response

    :no_entry_sign: invalid 
    opened by leopard2ic 7
  • test_client cannot connect with nginx-quic becauseof validate token failed

    test_client cannot connect with nginx-quic becauseof validate token failed

    Discussed in https://github.com/alibaba/xquic/discussions/87

    Originally posted by innocenceman February 16, 2022 What happened? xquic client connect to nginx-quic failed, and there is a error "quic garbage token while handling initial packet" in error.log xquic was built with boringssl, and the client is test_client, client show "conn errno:11" in the end.

    Steps To Reproduce download nginx-quic with version release-1.21.6, build and install it, run nginx with nginx.conf:"listen 8443 http3 reuseport". use test_client(command line: ./test_client -a xxx.xxx.xxx.xxx -p xxxx -G -l e -u https://www.xxxxx.com/) to request nginx-quic server.

    thanks xquic.zip

    :book: documentation 
    opened by innocenceman 7
  • [Bug]: send stream fragment packet, drop rate 75%

    [Bug]: send stream fragment packet, drop rate 75%

    What happened?

    1 Forward or schedule packet to xquic, send stream packet use function bellow void client_network_send(void *out_data, size_t out_dlen) { g_user_stream->send_body = out_data; g_user_stream->send_body_len = out_dlen; g_user_stream->send_offset = 0; client_stream_send(g_user_stream->stream, g_user_stream); }

    2 Send packet fragmentation would makes packet drop

    3 Looks like transport stream packets have scheduling issue

    Steps To Reproduce

    1 forward or schedule packet to xquic 2 send packet with function client_network_send( ) 3 send packet with fragmentation gets packet drop

    Relevant log output

    No response

    :raised_eyebrow: need more info 
    opened by leopard2ic 6
  • [Bug]: xqc_build.sh build iOS failed

    [Bug]: xqc_build.sh build iOS failed

    What happened?

    As discussions #21 , build iOS failed using xqc_build.sh

    Steps To Reproduce

    As discussions #21

    macOS 11.4 Xcode 12.5 cmake version 3.21.2

    1.export IOS_CMAKE_TOOLCHAIN="xx/xquic/cmake/ios.toolchain.cmake" 2. sh xqc_build.sh ios ios_build ios_release xxx/xquic/third_party/boringssl

    output: [ 1%] Generating crypto_test_data.cc make[2]: *** No rule to make target xxx/xquic/bssl_symbols.txt', needed by third_party/boringssl/symbol_prefix_include/boringssl_prefix_symbols.h'. Stop. make[1]: *** [third_party/boringssl/CMakeFiles/boringssl_prefix_symbols.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... [ 1%] Building CXX object third_party/boringssl/CMakeFiles/boringssl_gtest.dir/third_party/googletest/src/gtest-all.cc.o [ 1%] Building CXX object third_party/boringssl/CMakeFiles/crypto_test_data.dir/crypto_test_data.cc.o [ 1%] Built target crypto_test_data [ 1%] Linking CXX static library ../../outputs/libboringssl_gtest.a [ 1%] Built target boringssl_gtest make: *** [all] Error 2

    Relevant log output

    No response

    :lady_beetle: bug 
    opened by RuiqiZhou 6
  • [Bug]:xquic在windows下编译有错误

    [Bug]:xquic在windows下编译有错误

    What happened?

    按照最新版本的xquic中的platforms中在win10 64位上编译xquic,一直都报错,无法解决

    Steps To Reproduce

    windows环境: Win10 64位系统

    软件版本: Go:1.18.1 Cmake:3.23.1 Nasm:2.15 Visual studio:2017 因为环境不联网,没有办法下载安装vcpkg,从而libevent是自己离线安装的

    编译步骤: (1) 编译boringssl 当前下载的是4.23号的master分支代码,使用的是vs2017下的命令行提示符 如果按照platforms下的命令运行, cmake -DCMAKE_GENERATOR_PLATFORM=x64 --config Debug -DBUILD_SHARED_LIBS=0 -DCMAKE_C_FLAGS="-fPIC" -DCMAKE_CXX_FLAGS="-fPIC" .. 会报错,cmake error:unknown argument --config:

    将config命令去掉,成功不报错

    设置 set GO111MODULE=off 运行MSBuild.exe ALL_BUILD.vcxproj,生成lib

    (2) 编译xquic 运行命令: cmake -DSSL_TYPE=boringssl -DCMAKE_BUILD_TYPE=Debug -G "Visual Studio 15 2017 Win64" .. 不报错 继续运行: MSBuild.exe ALL_BUILD.vcxproj 会报一堆无法解析的错误 22

    Relevant log output

    No response

    opened by ziguang89 4
  • [Feature]: Retry support

    [Feature]: Retry support

    What happened?

    Xquic client can't complete handshake with quic-go server. Xquic was built with babassl, and it keep retrying when handshake with quic-go server.

    Steps To Reproduce

    Attached test client and server source file. Client can get connect_create_notify called but connect_handshake_finished never got called.

    thanks

    xquic.zip

    Relevant log output

    No response

    :bulb: enhancement :star_struck: someone working on it 
    opened by raulftang 4
  • [Feature]: FEC/RED functionality in the future?

    [Feature]: FEC/RED functionality in the future?

    Before request a new feature

    • [X] I have searched the issues of this repository and believe that this is not a duplicate.

    Describe the feature you'd like supported

    reference to RFC 2198、RFC 2733

    Describe alternatives you've considered

    No response

    Additional context

    No response

    :yarn: low priority 
    opened by adcen0107 3
  • fix a few gramma errors in API documentation

    fix a few gramma errors in API documentation

    I found multiple typos in API.md. A few sentences are quite elusive to me. I changed them liberally. Please correct me if there are any distortions. I also found one comment (annotated with a TODO) repeated in different contexts,.

    :book: documentation 
    opened by contrun 3
  • [Feature]: 使用xquic传输rtmp

    [Feature]: 使用xquic传输rtmp

    Before request a new feature

    • [X] I have searched the issues of this repository and believe that this is not a duplicate.

    Describe the feature you'd like supported

    目前 是否有单独的接口或者说明 直接使用xquic传输rtmp 包,不使用http 3 等相关接口和验证功能,或者可选在编译的时候去掉多余的spyd部分。

    Describe alternatives you've considered

    No response

    Additional context

    No response

    opened by wangpeng1 2
  • [Bug]: memory leak if connection closed during handshake

    [Bug]: memory leak if connection closed during handshake

    What happened?

    https://github.com/alibaba/xquic/blob/8fab2f91a468dc9f37ba02cca14d032ca8f40353/src/transport/xqc_conn.h#L310-L313

    These 3 lists are not cleared when connection destroy, so if the connection is closed during handshake (e.g. caused by a timeout), the xqc_hs_buffer_ts in these lists will leak.

    Steps To Reproduce

    I found this bug in a customized version, so I'm not sure this can be reproduced.

    Relevant log output

    No response

    :lady_beetle: bug 
    opened by Luffbee 0
  • [Bug]: 日志打印英文单词拼写错误

    [Bug]: 日志打印英文单词拼写错误

    What happened?

    xqc_crypto.c 函数 xqc_crypto_t * xqc_crypto_create(uint32_t cipher_id, xqc_log_t *log) 第114行 xqc_log(log, XQC_LOG_ERROR, "|not supoort cipher_id|%u|", cipher_id);

    Steps To Reproduce

    xqc_log(log, XQC_LOG_ERROR, "|not supoort cipher_id|%u|", cipher_id); 单词拼写错误,正确的应该是: xqc_log(log, XQC_LOG_ERROR, "|not support cipher_id|%u|", cipher_id);

    Relevant log output

    No response

    opened by adcen0107 0
  • [Bug]: cubic拥塞控制算法数据溢出

    [Bug]: cubic拥塞控制算法数据溢出

    What happened?

    在计算offs的三次方时,数据大于2^64次方,导致数据溢出

    offs:15974185, delta:7842627 tcp:234196 delta3:8623060531908964872 origin:271164 cwnd:935716 offs:16720817, delta:13108 tcp:234205 delta3:14412724670035656 origin:271164 cwnd:284272

    应改为 if(offs > 1024*1024){ offs = offs>>10 delta = (XQC_CUBIC_C * offs * offs * offs * XQC_CUBIC_MSS)>>10; } else delta = (XQC_CUBIC_C * offs * offs * offs * XQC_CUBIC_MSS) >> XQC_CUBE_SCALE;

    Steps To Reproduce

    运行cubic算法即可

    Relevant log output

    No response

    opened by padanes 0
  • [Bug]: No rttvar in the argument of REC_METRICS_UPDATED in BBR.

    [Bug]: No rttvar in the argument of REC_METRICS_UPDATED in BBR.

    The format "ctl_rttvar:%ui" exists in the argument of xqc_log_implement(), but ctl->ctl_rttvar is not specified in the argument. I think the output results are incorrect because the format and the number of arguments do not match.

    https://github.com/alibaba/xquic/blob/8fab2f91a468dc9f37ba02cca14d032ca8f40353/src/common/xqc_log_event_callback.c#L417-L422

    :lady_beetle: bug 
    opened by osa-bm 1
  • [Bug]: wrong macro used in xqc_write_new_token_to_packet

    [Bug]: wrong macro used in xqc_write_new_token_to_packet

    What happened?

    https://github.com/alibaba/xquic/blob/109918f980b3e649f0e7bce4d3bd926a6e44e002/src/transport/xqc_packet_out.c#L672 xqc_vint_len_by_val should be used, instead of xqc_vint_get_2bit.

    Steps To Reproduce

    read the code

    Relevant log output

    none
    
    :lady_beetle: bug 
    opened by Luffbee 0
Releases(v1.1.0-beta.2)
  • v1.1.0-beta.2(Jun 7, 2022)

    What's Changed

    [+] Handling retry packet [+] add conn closing notify [=] Fix RFC docs links in README-zh.md

    New Contributors

    • @yunwei37 made their first contribution in https://github.com/alibaba/xquic/pull/181

    Full Changelog: https://github.com/alibaba/xquic/compare/v1.1.0-beta.1...v1.1.0-beta.2

    Source code(tar.gz)
    Source code(zip)
  • v1.1.0-beta.1(Apr 27, 2022)

    What's Changed

    [+] Add Windows support (beta)

    [!] Fix xqc_pacing_rate_calc() return zero [!] Fix bug in xqc_str_hash_init when malloc return NULL [!] Fix reset_token_key and add test case

    New Contributors

    • @CherylQL made their first contribution in https://github.com/alibaba/xquic/pull/126
    • @wangweiwei1188 made their first contribution in https://github.com/alibaba/xquic/pull/132
    • @yuanbo-zhang made their first contribution in https://github.com/alibaba/xquic/pull/160

    Full Changelog: https://github.com/alibaba/xquic/compare/stable-1.0.1...v1.1.0-beta.1

    Source code(tar.gz)
    Source code(zip)
  • stable-1.0.1(Mar 30, 2022)

    What's Changed

    [!] fix cubic recovery [!] fix boringssl certificate verify error [!] fix update key phase before send_burst [!] fix compile error on macos [!] increase init_idle_time_out [~] add conn_alp_user_data in connection event callback functions

    New Contributors

    • @eltociear made their first contribution in https://github.com/alibaba/xquic/pull/95
    • @happyomg made their first contribution in https://github.com/alibaba/xquic/pull/110
    • @driventokill made their first contribution in https://github.com/alibaba/xquic/pull/111
    • @chenzhanfeng made their first contribution in https://github.com/alibaba/xquic/pull/113

    Full Changelog: https://github.com/alibaba/xquic/compare/stable-1.0.0...stable-1.1.0

    Source code(tar.gz)
    Source code(zip)
  • stable-1.0.0(Feb 16, 2022)

Owner
Alibaba
Alibaba Open Source
Alibaba
H2O - the optimized HTTP/1, HTTP/2, HTTP/3 server

H2O - an optimized HTTP server with support for HTTP/1.x, HTTP/2 and HTTP/3 (experimental) Copyright (c) 2014-2019 DeNA Co., Ltd., Kazuho Oku, Tatsuhi

H2O 10k Jun 25, 2022
QUIC, a multiplexed stream transport over UDP

QUIC, a multiplexed stream transport over UDP QUIC is an experimental protocol aimed at reducing web latency over that of TCP. On the surface, QUIC is

Devsisters Corp. 1.6k Jun 20, 2022
Simple HTTP protocol implementation in C

C-SimpleHTTP A simple HTTP protocol implementation in C How do i run it? First of all, this project is made in c, then you will need GCC Compiler. The

Spar 8 May 25, 2022
Mongoose Embedded Web Server Library - a multi-protocol embedded networking library with TCP/UDP, HTTP, WebSocket, MQTT built-in protocols, async DNS resolver, and non-blocking API.

Mongoose - Embedded Web Server / Embedded Networking Library Mongoose is a networking library for C/C++. It implements event-driven non-blocking APIs

Cesanta Software 8.5k Jun 29, 2022
Cross-platform, efficient, customizable, and robust asynchronous HTTP/WebSocket server C++14 library with the right balance between performance and ease of use

What Is RESTinio? RESTinio is a header-only C++14 library that gives you an embedded HTTP/Websocket server. It is based on standalone version of ASIO

Stiffstream 863 Jun 23, 2022
Small and fast cross-platform networking library, with support for messaging, IPv6, HTTP, SSL and WebSocket.

frnetlib Frnetlib, is a cross-platform, small and fast networking library written in C++. There are no library dependencies (unless you want to use SS

Fred Nicolson 22 May 16, 2022
A cross-platform HTTP client library with a focus on usability and speed

EasyHttp A cross-platform HTTP client library with a focus on usability and speed. Under its hood, EasyHttp uses POCO C++ Libraries and derives many o

Sony 141 Jun 17, 2022
Tiny cross-platform HTTP / HTTPS client library in C.

naett /nɛt:/ Tiny HTTP client library in C. Wraps native HTTP client functionality on macOS, Windows, Linux, iOS and Android in a single, simple non-b

Erik Agsjö 13 Jun 21, 2022
SoftEther VPN - Cross-platform multi-protocol VPN software.

SoftEther VPN - Cross-platform multi-protocol VPN software.

SoftEther 9k Jun 20, 2022
aria2 is a lightweight multi-protocol & multi-source, cross platform download utility operated in command-line.

aria2 is a lightweight multi-protocol & multi-source, cross platform download utility operated in command-line. It supports HTTP/HTTPS, FTP, SFTP, BitTorrent and Metalink.

aria2 26.7k Jun 22, 2022
modern c++(c++17), cross-platform, header-only, easy to use http framework

cinatra--一个高效易用的c++ http框架 English | 中文 目录 使用cinatra常见问题汇总(FAQ) cinatra简介 如何使用 快速示例 性能测试 注意事项 roadmap 联系方式 cinatra简介 cinatra是一个高性能易用的http框架,它是用modern

qicosmos 1.3k Jun 21, 2022
A cross-platform network learning demos. Like high-performance http server

Network-Learn A cross-platform network learning demos (toys). And I try not to use 3rd-party libraries. Welcome to try it out and leave your comments.

Ho 229 24 Apr 15, 2022
Cross-platform, single .h file HTTP server (Windows, Linux, Mac OS X)

EWS - Single .h File C Embeddable Web Server Latest Version: 1.1.4 released September 9, 2021 Supported platforms: Linux, Mac OS X, Windows License: B

Forrest Heller 75 May 18, 2022
Pushpin is a reverse proxy server written in C++ that makes it easy to implement WebSocket, HTTP streaming, and HTTP long-polling services.

Pushpin is a reverse proxy server written in C++ that makes it easy to implement WebSocket, HTTP streaming, and HTTP long-polling services. The project is unique among realtime push solutions in that it is designed to address the needs of API creators. Pushpin is transparent to clients and integrates easily into an API stack.

Fanout 3.1k Jun 22, 2022
Gromox - Groupware server backend with MAPI/HTTP, RPC/HTTP, IMAP, POP3 and PHP-MAPI support for grommunio

Gromox is the central groupware server component of grommunio. It is capable of serving as a replacement for Microsoft Exchange and compatibles. Conne

grommunio 119 Jun 27, 2022
tiny HTTP parser written in C (used in HTTP::Parser::XS et al.)

PicoHTTPParser Copyright (c) 2009-2014 Kazuho Oku, Tokuhiro Matsuno, Daisuke Murase, Shigeo Mitsunari PicoHTTPParser is a tiny, primitive, fast HTTP r

H2O 1.5k Jun 22, 2022
A collection of C++ HTTP libraries including an easy to use HTTP server.

Proxygen: Facebook's C++ HTTP Libraries This project comprises the core C++ HTTP abstractions used at Facebook. Internally, it is used as the basis fo

Facebook 7.5k Jun 25, 2022
cuehttp is a modern c++ middleware framework for http(http/https)/websocket(ws/wss).

cuehttp 简介 cuehttp是一个使用Modern C++(C++17)编写的跨平台、高性能、易用的HTTP/WebSocket框架。基于中间件模式可以方便、高效、优雅的增加功能。cuehttp基于boost.asio开发,使用picohttpparser进行HTTP协议解析。内部依赖了nl

xcyl 25 Jun 21, 2022
A very simple, fast, multithreaded, platform independent HTTP and HTTPS server and client library implemented using C++11 and Boost.Asio.

A very simple, fast, multithreaded, platform independent HTTP and HTTPS server and client library implemented using C++11 and Boost.Asio. Created to be an easy way to make REST resources available from C++ applications.

Ole Christian Eidheim 2.3k Jun 22, 2022