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
Comments
  • [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
  • [Bug]: compile failed due to BabaSSL break change?

    [Bug]: compile failed due to BabaSSL break change?

    What happened?

    Seems BabaSSL has break changes, they renamed to Tongsuo.

    /extern_disk/home/lyf/xquic/src/transport/xqc_packet_parser.c: In function ‘xqc_gen_reset_token’:
    /extern_disk/home/lyf/xquic/src/transport/xqc_packet_parser.c:1300:5: error: ‘HMAC_CTX_new’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
         HMAC_CTX *ctx = HMAC_CTX_new();
         ^~~~~~~~
    In file included from /extern_disk/home/lyf/xquic/src/transport/xqc_packet_parser.c:9:0:
    /extern_disk/home/lyf/xquic/third_party/babassl/include/openssl/hmac.h:33:33: note: declared here
     OSSL_DEPRECATEDIN_3_0 HMAC_CTX *HMAC_CTX_new(void);
                                     ^~~~~~~~~~~~
    /extern_disk/home/lyf/xquic/src/transport/xqc_packet_parser.c:1301:5: error: ‘HMAC_CTX_reset’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
         HMAC_CTX_reset(ctx);
         ^~~~~~~~~~~~~~
    In file included from /extern_disk/home/lyf/xquic/src/transport/xqc_packet_parser.c:9:0:
    /extern_disk/home/lyf/xquic/third_party/babassl/include/openssl/hmac.h:34:27: note: declared here
     OSSL_DEPRECATEDIN_3_0 int HMAC_CTX_reset(HMAC_CTX *ctx);
                               ^~~~~~~~~~~~~~
    /extern_disk/home/lyf/xquic/src/transport/xqc_packet_parser.c:1302:5: error: ‘HMAC_Init_ex’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
         HMAC_Init_ex(ctx, key, keylen, engine, NULL);
         ^~~~~~~~~~~~
    In file included from /extern_disk/home/lyf/xquic/src/transport/xqc_packet_parser.c:9:0:
    /extern_disk/home/lyf/xquic/third_party/babassl/include/openssl/hmac.h:43:27: note: declared here
     OSSL_DEPRECATEDIN_3_0 int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
                               ^~~~~~~~~~~~
    /extern_disk/home/lyf/xquic/src/transport/xqc_packet_parser.c:1303:5: error: ‘HMAC_Update’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
         HMAC_Update(ctx, input, input_len);
         ^~~~~~~~~~~
    In file included from /extern_disk/home/lyf/xquic/src/transport/xqc_packet_parser.c:9:0:
    /extern_disk/home/lyf/xquic/third_party/babassl/include/openssl/hmac.h:45:27: note: declared here
     OSSL_DEPRECATEDIN_3_0 int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data,
                               ^~~~~~~~~~~
    .......
    .......
    

    Steps To Reproduce

    just compile xquic following the build doc.

    Relevant log output

    No response

    :book: documentation help wanted 
    opened by Luffbee 3
  • [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
  • [Bug]: cmake指定Release编译报错

    [Bug]: cmake指定Release编译报错

    What happened?

    使用master分支编译xquic会出现错误 commit id 6348479fbd8611034dfd5e633b59ef31931da94b
    系统Ubuntu 20.04 focal x86_64 Linux 5.15.0-56-generic 以下是编译命令

    # 获取 XQUIC 源码
    git clone https://github.com/alibaba/xquic.git
    cd xquic
    
    # 编译 BabaSSL
    git clone -b 8.3-stable https://github.com/Tongsuo-Project/Tongsuo.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 -
    
    git submodule update --init --recursive
    mkdir -p build; cd build
    cmake -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
    

    cmake日志输出如下

    darren@darren-build-machine:~/xquic/xquic/build$ cmake -DSSL_TYPE=${SSL_TYPE_STR} -DSSL_PATH=${SSL_PATH_STR} -DSSL_INC_PATH=${SSL_INC_PATH_STR} -DSSL_LIB_PATH=${SSL_LIB_PATH_STR} ..
    -- The C compiler identification is GNU 9.4.0
    -- The CXX compiler identification is GNU 9.4.0
    -- Check for working C compiler: /usr/bin/cc
    -- Check for working C compiler: /usr/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: /usr/bin/c++
    -- Check for working CXX compiler: /usr/bin/c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    SSL_TYPE= babassl
    SSL_PATH= /home/darren/xquic/xquic/third_party/babassl
    SSL_LIB_PATH= /home/darren/xquic/xquic/third_party/babassl/libssl.a;/home/darren/xquic/xquic/third_party/babassl/libcrypto.a
    SSL_INC_PATH= /home/darren/xquic/xquic/third_party/babassl/include
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/darren/xquic/xquic/build
    

    Steps To Reproduce

    cmake -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
    

    Relevant log output

    darren@darren-build-machine:~/xquic/xquic/build$ make
    Scanning dependencies of target xquic
    [  0%] Building C object CMakeFiles/xquic.dir/src/http3/xqc_h3_conn.c.o
    [  1%] Building C object CMakeFiles/xquic.dir/src/http3/xqc_h3_stream.c.o
    [  2%] Building C object CMakeFiles/xquic.dir/src/http3/xqc_h3_request.c.o
    [  3%] Building C object CMakeFiles/xquic.dir/src/http3/frame/xqc_h3_frame.c.o
    [  4%] Building C object CMakeFiles/xquic.dir/src/http3/xqc_h3_header.c.o
    [  4%] Building C object CMakeFiles/xquic.dir/src/http3/xqc_h3_ctx.c.o
    [  5%] Building C object CMakeFiles/xquic.dir/src/http3/xqc_h3_defs.c.o
    [  6%] Building C object CMakeFiles/xquic.dir/src/http3/qpack/xqc_qpack.c.o
    [  7%] Building C object CMakeFiles/xquic.dir/src/http3/qpack/xqc_prefixed_int.c.o
    [  8%] Building C object CMakeFiles/xquic.dir/src/http3/qpack/xqc_prefixed_str.c.o
    [  8%] Building C object CMakeFiles/xquic.dir/src/http3/qpack/xqc_decoder.c.o
    [  9%] Building C object CMakeFiles/xquic.dir/src/http3/qpack/xqc_encoder.c.o
    [ 10%] Building C object CMakeFiles/xquic.dir/src/http3/qpack/xqc_rep.c.o
    [ 11%] Building C object CMakeFiles/xquic.dir/src/http3/qpack/xqc_ins.c.o
    [ 12%] Building C object CMakeFiles/xquic.dir/src/http3/qpack/stable/xqc_stable.c.o
    [ 12%] Building C object CMakeFiles/xquic.dir/src/http3/qpack/dtable/xqc_dtable.c.o
    [ 13%] Building C object CMakeFiles/xquic.dir/src/transport/xqc_engine.c.o
    [ 14%] Building C object CMakeFiles/xquic.dir/src/transport/xqc_conn.c.o
    [ 15%] Building C object CMakeFiles/xquic.dir/src/transport/xqc_client.c.o
    In file included from /usr/include/string.h:495,
                     from /home/darren/xquic/xquic/src/common/xqc_str.h:8,
                     from /home/darren/xquic/xquic/src/common/xqc_common_inc.h:10,
                     from /home/darren/xquic/xquic/src/common/utils/var_buf/xqc_var_buf.h:8,
                     from /home/darren/xquic/xquic/src/http3/xqc_h3_stream.h:8,
                     from /home/darren/xquic/xquic/src/transport/xqc_client.c:6:
    In function ‘strncpy’,
        inlined from ‘xqc_client_create_tls’ at /home/darren/xquic/xquic/src/transport/xqc_client.c:156:5:
    /usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
      106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /home/darren/xquic/xquic/src/transport/xqc_client.c: In function ‘xqc_client_create_tls’:
    /home/darren/xquic/xquic/src/transport/xqc_client.c:149:16: note: length computed here
      149 |     alpn_cap = strlen(alpn) + 1;
          |                ^~~~~~~~~~~~
    In file included from /usr/include/string.h:495,
                     from /home/darren/xquic/xquic/src/common/xqc_str.h:8,
                     from /home/darren/xquic/xquic/src/common/xqc_common_inc.h:10,
                     from /home/darren/xquic/xquic/src/common/utils/var_buf/xqc_var_buf.h:8,
                     from /home/darren/xquic/xquic/src/http3/xqc_h3_stream.h:8,
                     from /home/darren/xquic/xquic/src/transport/xqc_client.c:6:
    In function ‘strncpy’,
        inlined from ‘xqc_client_create_tls’ at /home/darren/xquic/xquic/src/transport/xqc_client.c:166:5:
    /usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
      106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /home/darren/xquic/xquic/src/transport/xqc_client.c: In function ‘xqc_client_create_tls’:
    /home/darren/xquic/xquic/src/transport/xqc_client.c:159:16: note: length computed here
      159 |     host_cap = strlen(hostname) + 1;
          |                ^~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors
    make[2]: *** [CMakeFiles/xquic.dir/build.make:297: CMakeFiles/xquic.dir/src/transport/xqc_client.c.o] Error 1
    make[1]: *** [CMakeFiles/Makefile2:78: CMakeFiles/xquic.dir/all] Error 2
    make: *** [Makefile:84: all] Error 2
    darren@darren-build-machine:~/xquic/xquic/build$
    
    opened by dreamcmi 1
  • xqc_pow2 cann't work in windows.

    xqc_pow2 cann't work in windows.

    #include <assert.h>
    #include <math.h>
    #ifdef _WIN32
    #include <intrin.h>
    #define XQC_SYS_WINDOWS 1
    #endif
    /* make n to 2 pow  */
    static int xqc_pow2(unsigned int n)
    {
        int count1 = 0;    
        unsigned long power = sizeof(n);
    #ifdef __GNUC__
        count1 = __builtin_popcount(n);
    #else
        unsigned int t = n;
        while (t) {
            count1 += t & 1;
            t >>= 1;
        }
    #endif
        if (count1 <= 1) {
            return n;
        }
    #if defined(XQC_SYS_WINDOWS) && defined(_MSC_VER)
        /* __lzcnt available beginning VS2008 or up*/
        _BitScanReverse((unsigned long *)&power, n);    
    #else
        power = (power << 3) - __builtin_clz(n) - 1;    
    #endif
        return (int)pow(2, power);
    }
    int main()
    {
        assert(xqc_pow2(4) == 4);
        assert(xqc_pow2(12) == 8);
        assert(xqc_pow2(1024) == 1024);
        assert(xqc_pow2(0) == 0);
        assert(xqc_pow2(1) == 1);
    }
    
    opened by keengo99 1
  • [Bug]: nonce computation error in multipath-ietf-draft-01 branch

    [Bug]: nonce computation error in multipath-ietf-draft-01 branch

    What happened?

    multipath的 nonce计算时 path id应该是网络序,现在貌似是主机序?

    问题可能出现在:https://github.com/alibaba/xquic/blob/ceeed29947e7ad148e097d75c26ba6407368af36/src/tls/xqc_crypto.c#L158

    Steps To Reproduce

    RFC测试实例:

    # https://quicwg.org/multipath/draft-ietf-quic-multipath.html#name-packet-protection-for-quic-
    
    IV: 6b26114b9cba2b63a9e8dd4f
    PN: aead
    SN: 3
    ==
    nonce: 6b2611489cba2b63a9e873e2
    

    Relevant log output

    No response

    :star_struck: someone working on it 
    opened by nandsky 0
  • [Bug]: Address validation token is too easy.

    [Bug]: Address validation token is too easy.

    What happened?

    8.1.4.Address Validation Token Integrity An address validation token MUST be difficult to guess. Including a random value with at least 128 bits of entropy in the token would be sufficient, but this depends on the server remembering the value it sends to clients.

    Xquic use ip address + expire time as token.

    Steps To Reproduce

    Read the code.

    Relevant log output

    No response

    opened by Luffbee 0
  • [Bug]: Is there any serious test on xquic?

    [Bug]: Is there any serious test on xquic?

    What happened?

    I found many memory leak bugs, it seems xquic is not tested in extreme scenarios (e.g. high loss rate).

    Steps To Reproduce

    See my issues.

    Relevant log output

    No response

    opened by Luffbee 0
  • [Bug]: memory leak: xqc_process_crypto_frame: stream_frame

    [Bug]: memory leak: xqc_process_crypto_frame: stream_frame

    What happened?

    The memory allocate for stream_frame may leak.

    Steps To Reproduce

    valgrind it in high loss environment.

    Relevant log output

    No response

    :lady_beetle: bug :star_struck: someone working on it 
    opened by Luffbee 6
Releases(v1.3.0-beta)
  • v1.3.0-beta(Nov 8, 2022)

    What's Changed

    • [-] remove redundant code in the window filter;
    • [+] add a new congestion controller, Copa (issue: https://github.com/alibaba/xquic/issues/130);
    • [~] fix several bugs in BBR, Cubic (issues: https://github.com/alibaba/xquic/issues/243, https://github.com/alibaba/xquic/issues/194), and Rate Sampling;
    • [+] add a macro to disable the ad-hoc heuristics in BBR;
    • [+] add an internal function to get MSS.

    New Contributors

    • @yangfurong (PR: https://github.com/alibaba/xquic/pull/258)

    Full Changelog: https://github.com/alibaba/xquic/compare/v1.2.0-stable...v1.3.0-beta

    Source code(tar.gz)
    Source code(zip)
  • v1.2.0-stable(Aug 26, 2022)

    What's Changed

    • [~] Added parameter descriptions by @CherylQL in https://github.com/alibaba/xquic/pull/213
    • [~]Update Platform.md by @ruanshanshan in https://github.com/alibaba/xquic/pull/185
    • [~] fix issue #208 by @Yanmei-Liu in https://github.com/alibaba/xquic/pull/214
    • [~] fix issue #203, fix log_event type by @Yanmei-Liu in https://github.com/alibaba/xquic/pull/215
    • [=] fix issue #202, frame type by @Yanmei-Liu in https://github.com/alibaba/xquic/pull/216
    • [~] fix issue #180, new_token length calculation by @Yanmei-Liu in https://github.com/alibaba/xquic/pull/217
    • [=] fix issue #195, log print typo by @Yanmei-Liu in https://github.com/alibaba/xquic/pull/218
    • [~] fix issue #187, print rttvar in BBR by @Yanmei-Liu in https://github.com/alibaba/xquic/pull/219
    • [!] fix issue #220, compile warning by @RuiqiZhou in https://github.com/alibaba/xquic/pull/221
    • [!] Fix problems caused by interface coupling by @RuiqiZhou in https://github.com/alibaba/xquic/pull/229

    New Contributors

    • @ruanshanshan made their first contribution in https://github.com/alibaba/xquic/pull/185
    • @Yanmei-Liu made their first contribution in https://github.com/alibaba/xquic/pull/214

    Full Changelog: https://github.com/alibaba/xquic/compare/v1.1.0-stable...v1.2.0-stable

    Source code(tar.gz)
    Source code(zip)
  • multipath-draft-01-beta.1(Aug 29, 2022)

  • v1.1.0-stable(Jul 26, 2022)

    What's Changed

    • [+] Add RFC9221 translation. by @robinhzp in https://github.com/alibaba/xquic/pull/193
    • [!] send_ctl bugfix
    • [!] fix qpack duplicate
    • [!] add path_challenge & path_response frame to fix NAT rebinding
    • [+] add encryption option to load balancer cid generator

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

    Source code(tar.gz)
    Source code(zip)
  • 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 10.2k Dec 30, 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.7k Dec 31, 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
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 924 Jan 6, 2023
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 23 Nov 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 9k Jan 1, 2023
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 148 Dec 30, 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ö 21 Nov 28, 2022
SoftEther VPN - Cross-platform multi-protocol VPN software.

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

SoftEther 9.6k Jan 4, 2023
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 28.7k Jan 7, 2023
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.4k Dec 30, 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 Sep 6, 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 84 Dec 19, 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.2k Jan 2, 2023
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 139 Dec 26, 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.6k Jan 1, 2023
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.7k Jan 4, 2023
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 29 Dec 17, 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.4k Dec 23, 2022