comparison mupdf-source/thirdparty/curl/docs/HTTP3.md @ 2:b50eed0cc0ef upstream

ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4. The directory name has changed: no version number in the expanded directory now.
author Franz Glasner <fzglas.hg@dom66.de>
date Mon, 15 Sep 2025 11:43:07 +0200
parents
children
comparison
equal deleted inserted replaced
1:1d09e1dec1d9 2:b50eed0cc0ef
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 experiementing 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
33
34 Build (patched) OpenSSL
35
36 % git clone --depth 1 -b openssl-quic-draft-22 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 -b draft-22 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,<somehere1>/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>
69 % make
70
71 ## Running
72
73 Make sure the custom OpenSSL library is the one used at run-time, as otherwise
74 you'll just get ld.so linker errors.
75
76 ## Invoke from command line
77
78 curl --http3 https://nghttp2.org:8443/
79
80 # quiche version
81
82 ## build
83
84 Clone quiche and BoringSSL:
85
86 % git clone --recursive https://github.com/cloudflare/quiche
87
88 Build BoringSSL (it needs to be built manually so it can be reused with curl):
89
90 % cd quiche/deps/boringssl
91 % mkdir build
92 % cd build
93 % cmake -DCMAKE_POSITION_INDEPENDENT_CODE=on ..
94 % make -j`nproc`
95 % cd ..
96 % mkdir .openssl/lib -p
97 % cp build/crypto/libcrypto.a build/ssl/libssl.a .openssl/lib
98 % ln -s $PWD/include .openssl
99
100 Build quiche:
101
102 % cd ../..
103 % QUICHE_BSSL_PATH=$PWD/deps/boringssl cargo build --release --features pkg-config-meta
104
105 Clone and build curl:
106
107 % cd ..
108 % git clone https://github.com/curl/curl
109 % cd curl
110 % ./buildconf
111 % ./configure LDFLAGS="-Wl,-rpath,$PWD/../quiche/target/release" --with-ssl=$PWD/../quiche/deps/boringssl/.openssl --with-quiche=$PWD/../quiche/target/release
112 % make -j`nproc`
113
114 ## Running
115
116 Make an HTTP/3 request.
117
118 % src/curl --http3 https://cloudflare-quic.com/
119 % src/curl --http3 https://facebook.com/
120 % src/curl --http3 https://quic.aiortc.org:4433/
121 % src/curl --http3 https://quic.rocks:4433/