Annotation of embedaddon/curl/docs/HTTP3.md, revision 1.1

1.1     ! misho       1: # HTTP3 (and QUIC)
        !             2: 
        !             3: ## Resources
        !             4: 
        !             5: [HTTP/3 Explained](https://daniel.haxx.se/http3-explained/) - the online free
        !             6: book describing the protocols involved.
        !             7: 
        !             8: [QUIC implementation](https://github.com/curl/curl/wiki/QUIC-implementation) -
        !             9: the wiki page describing the plan for how to support QUIC and HTTP/3 in curl
        !            10: and libcurl.
        !            11: 
        !            12: [quicwg.org](https://quicwg.org/) - home of the official protocol drafts
        !            13: 
        !            14: ## QUIC libraries
        !            15: 
        !            16: QUIC libraries we're experimenting with:
        !            17: 
        !            18: [ngtcp2](https://github.com/ngtcp2/ngtcp2)
        !            19: 
        !            20: [quiche](https://github.com/cloudflare/quiche)
        !            21: 
        !            22: ## Experimental!
        !            23: 
        !            24: HTTP/3 and QUIC support in curl is considered **EXPERIMENTAL** until further
        !            25: notice. It needs to be enabled at build-time.
        !            26: 
        !            27: Further development and tweaking of the HTTP/3 support in curl will happen in
        !            28: in the master branch using pull-requests, just like ordinary changes.
        !            29: 
        !            30: # ngtcp2 version
        !            31: 
        !            32: ## Build with OpenSSL
        !            33: 
        !            34: Build (patched) OpenSSL
        !            35: 
        !            36:      % git clone --depth 1 -b OpenSSL_1_1_1d-quic-draft-27 https://github.com/tatsuhiro-t/openssl
        !            37:      % cd openssl
        !            38:      % ./config enable-tls1_3 --prefix=<somewhere1>
        !            39:      % make
        !            40:      % make install_sw
        !            41: 
        !            42: Build nghttp3
        !            43: 
        !            44:      % cd ..
        !            45:      % git clone https://github.com/ngtcp2/nghttp3
        !            46:      % cd nghttp3
        !            47:      % autoreconf -i
        !            48:      % ./configure --prefix=<somewhere2> --enable-lib-only
        !            49:      % make
        !            50:      % make install
        !            51: 
        !            52: Build ngtcp2
        !            53: 
        !            54:      % cd ..
        !            55:      % git clone https://github.com/ngtcp2/ngtcp2
        !            56:      % cd ngtcp2
        !            57:      % autoreconf -i
        !            58:      % ./configure PKG_CONFIG_PATH=<somewhere1>/lib/pkgconfig:<somewhere2>/lib/pkgconfig LDFLAGS="-Wl,-rpath,<somewhere1>/lib" --prefix=<somewhere3>
        !            59:      % make
        !            60:      % make install
        !            61: 
        !            62: Build curl
        !            63: 
        !            64:      % cd ..
        !            65:      % git clone https://github.com/curl/curl
        !            66:      % cd curl
        !            67:      % ./buildconf
        !            68:      % LDFLAGS="-Wl,-rpath,<somewhere1>/lib" ./configure --with-ssl=<somewhere1> --with-nghttp3=<somewhere2> --with-ngtcp2=<somewhere3> --enable-alt-svc
        !            69:      % make
        !            70: 
        !            71: ## Build with GnuTLS
        !            72: 
        !            73: Build (patched) GnuTLS
        !            74: 
        !            75:      % git clone --depth 1 -b tmp-quic https://gitlab.com/gnutls/gnutls.git
        !            76:      % cd gnutls
        !            77:      % ./bootstrap
        !            78:      % ./configure --disable-doc --prefix=<somewhere1>
        !            79:      % make
        !            80:      % make install
        !            81: 
        !            82: Build nghttp3
        !            83: 
        !            84:      % cd ..
        !            85:      % git clone https://github.com/ngtcp2/nghttp3
        !            86:      % cd nghttp3
        !            87:      % autoreconf -i
        !            88:      % ./configure --prefix=<somewhere2> --enable-lib-only
        !            89:      % make
        !            90:      % make install
        !            91: 
        !            92: Build ngtcp2
        !            93: 
        !            94:      % cd ..
        !            95:      % git clone https://github.com/ngtcp2/ngtcp2
        !            96:      % cd ngtcp2
        !            97:      % autoreconf -i
        !            98:      % ./configure PKG_CONFIG_PATH=<somewhere1>/lib/pkgconfig:<somewhere2>/lib/pkgconfig LDFLAGS="-Wl,-rpath,<somewhere1>/lib" --prefix=<somewhere3>
        !            99:      % make
        !           100:      % make install
        !           101: 
        !           102: Build curl
        !           103: 
        !           104:      % cd ..
        !           105:      % git clone https://github.com/curl/curl
        !           106:      % cd curl
        !           107:      % ./buildconf
        !           108:      % ./configure --without-ssl --with-gnutls=<somewhere1> --with-nghttp3=<somewhere2> --with-ngtcp2=<somewhere3> --enable-alt-svc
        !           109:      % make
        !           110: 
        !           111: # quiche version
        !           112: 
        !           113: ## build
        !           114: 
        !           115: Clone quiche and BoringSSL:
        !           116: 
        !           117:      % git clone --recursive https://github.com/cloudflare/quiche
        !           118: 
        !           119: Build BoringSSL (it needs to be built manually so it can be reused with curl):
        !           120: 
        !           121:      % cd quiche/deps/boringssl
        !           122:      % mkdir build
        !           123:      % cd build
        !           124:      % cmake -DCMAKE_POSITION_INDEPENDENT_CODE=on ..
        !           125:      % make
        !           126:      % cd ..
        !           127:      % mkdir -p .openssl/lib
        !           128:      % cp build/crypto/libcrypto.a build/ssl/libssl.a .openssl/lib
        !           129:      % ln -s $PWD/include .openssl
        !           130: 
        !           131: Build quiche:
        !           132: 
        !           133:      % cd ../..
        !           134:      % QUICHE_BSSL_PATH=$PWD/deps/boringssl cargo build --release --features pkg-config-meta
        !           135: 
        !           136: Build curl:
        !           137: 
        !           138:      % cd ..
        !           139:      % git clone https://github.com/curl/curl
        !           140:      % cd curl
        !           141:      % ./buildconf
        !           142:      % ./configure LDFLAGS="-Wl,-rpath,$PWD/../quiche/target/release" --with-ssl=$PWD/../quiche/deps/boringssl/.openssl --with-quiche=$PWD/../quiche/target/release --enable-alt-svc
        !           143:      % make
        !           144: 
        !           145: ## Run
        !           146: 
        !           147: Use HTTP/3 directly:
        !           148: 
        !           149:     curl --http3 https://nghttp2.org:8443/
        !           150: 
        !           151: Upgrade via Alt-Svc:
        !           152: 
        !           153:     curl --alt-svc altsvc.cache https://quic.aiortc.org/
        !           154: 
        !           155: See this [list of public HTTP/3 servers](https://bagder.github.io/HTTP3-test/)

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>