Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
2,508 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# HTTP3 (and QUIC) | ||
|
||
## Resources | ||
|
||
[HTTP/3 Explained](https://daniel.haxx.se/http3-explained/) - the online free | ||
book describing the protocols involved. | ||
|
||
[QUIC implementation](https://github.com/curl/curl/wiki/QUIC-implementation) - | ||
the wiki page describing the plan for how to support QUIC and HTTP/3 in curl | ||
and libcurl. | ||
|
||
[quicwg.org](https://quicwg.org/) - home of the official protocol drafts | ||
|
||
## QUIC libraries | ||
|
||
QUIC libraries we're experiementing with: | ||
|
||
[ngtcp2](https://github.com/ngtcp2/ngtcp2) | ||
|
||
[quiche](https://github.com/ghedo/quiche) | ||
|
||
## Experimental! | ||
|
||
HTTP/3 and QUIC support in curl is not yet working and this is early days. | ||
Consider all QUIC and HTTP/3 code to be **EXPERIMENTAL** until further notice. | ||
|
||
curl does not have HTTP/3 support (yet). | ||
|
||
The bleeding edge QUIC work is done in the dedicated | ||
[QUIC](https://github.com/curl/curl/tree/QUIC) branch, but the plan is to | ||
merge as often as possible from there to master. All QUIC related code will | ||
remain being build-time conditionally enabled. | ||
|
||
# ngtcp2 version | ||
|
||
## Build | ||
|
||
1. clone ngtcp2 from git (the draft-17 branch) | ||
2. build and install ngtcp2's custom OpenSSL version (the quic-draft-17 branch) | ||
3. build and install ngtcp2 according to its instructions | ||
4. configure curl with ngtcp2 support: `./configure --with-ngtcp2=<install prefix>` | ||
5. build curl "normally" | ||
|
||
## Running | ||
|
||
Make sure the custom OpenSSL library is the one used at run-time, as otherwise | ||
you'll just get ld.so linker errors. | ||
|
||
## Invoke from command line | ||
|
||
curl --http3-direct https://nghttp2.org:8443/ | ||
|
||
# quiche version | ||
|
||
## build | ||
|
||
Build BoringSSL (it needs to be built manually so it can be reused with curl): | ||
|
||
% mkdir -p quiche/deps/boringssl/build | ||
% cd quiche/deps/boringssl/build | ||
% cmake -DCMAKE_POSITION_INDEPENDENT_CODE=on .. | ||
% make -j`nproc` | ||
% cd .. | ||
% mkdir .openssl/lib -p | ||
% cp build/crypto/libcrypto.a build/ssl/libssl.a .openssl/lib | ||
% ln -s $PWD/include .openssl | ||
|
||
Build quiche: | ||
|
||
% cd ../.. | ||
% QUICHE_BSSL_PATH=$PWD/deps/boringssl cargo build | ||
|
||
Clone and build curl: | ||
|
||
% cd .. | ||
% git clone -b quiche https://github.com/ghedo/curl | ||
% ./buildconf | ||
% ./configure --with-ssl=$PWD/../quiche/deps/boringssl/.openssl --with-quiche=$PWD/../quiche --enable-debug | ||
% make -j`nproc` | ||
|
||
## Running | ||
|
||
Make an HTTP/1.1 request to a QUIC server: | ||
|
||
% src/curl --http3-direct https://cloudflare-quic.com/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Long: http3-direct | ||
Tags: Versions | ||
Protocols: HTTP | ||
Added: 7.66.0 | ||
Mutexed: http1.1 http1.0 http2 http2-prior-knowledge | ||
Requires: HTTP/3 | ||
Help: Use HTTP v3 | ||
--- | ||
|
||
Tells curl to use HTTP version 3 directly to the host and port number used in | ||
the URL. A normal HTTP/3 transaction will be done to a host and then get | ||
redirected via Alt-SVc, but this option allows a user to circumvent that when | ||
you know that the target speaks HTTP/3 on the given host and port. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
.\" ************************************************************************** | ||
.\" * _ _ ____ _ | ||
.\" * Project ___| | | | _ \| | | ||
.\" * / __| | | | |_) | | | ||
.\" * | (__| |_| | _ <| |___ | ||
.\" * \___|\___/|_| \_\_____| | ||
.\" * | ||
.\" * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al. | ||
.\" * | ||
.\" * This software is licensed as described in the file COPYING, which | ||
.\" * you should have received as part of this distribution. The terms | ||
.\" * are also available at https://curl.haxx.se/docs/copyright.html. | ||
.\" * | ||
.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell | ||
.\" * copies of the Software, and permit persons to whom the Software is | ||
.\" * furnished to do so, under the terms of the COPYING file. | ||
.\" * | ||
.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
.\" * KIND, either express or implied. | ||
.\" * | ||
.\" ************************************************************************** | ||
.\" | ||
.TH CURLOPT_H3 3 "27 Nov 2018" "libcurl 7.64.0" "curl_easy_setopt options" | ||
.SH NAME | ||
CURLOPT_H3 \- specify HTTP/3 protocol behavior | ||
.SH SYNOPSIS | ||
#include <curl/curl.h> | ||
|
||
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_H3, long bitmask); | ||
.SH DESCRIPTION | ||
This function accepts a long \fIbitmask\fP with a set of flags set that | ||
controls the HTTP/3 behavior for this transfer. | ||
.IP "CURLH3_DIRECT" | ||
If this bit is set in \fIbitmask\fP, the host name and port number given in | ||
the URL will be used to connect to directly with QUIC and the port number then | ||
being a UDP port number. | ||
.SH DEFAULT | ||
0 | ||
.SH PROTOCOLS | ||
HTTPS | ||
.SH EXAMPLE | ||
.nf | ||
CURL *curl = curl_easy_init(); | ||
if(curl) { | ||
CURLcode ret; | ||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); | ||
curl_easy_setopt(curl, CURLOPT_H3, (long)CURLH3_DIRECT); | ||
ret = curl_easy_perform(curl); | ||
} | ||
.fi | ||
.SH AVAILABILITY | ||
Added in 7.64.0 | ||
.SH RETURN VALUE | ||
Returns CURLE_OK if supported, an error otherwise. | ||
.SH "SEE ALSO" | ||
.BR CURLOPT_HTTP_VERSION "(3), " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.