mirror of
https://github.com/moparisthebest/curl
synced 2024-11-10 11:35:07 -05:00
2.7 KiB
2.7 KiB
Alt-Svc
curl features EXPERIMENTAL support for the Alt-Svc: HTTP header.
Experimental
Experimental support in curl means:
- Experimental features are provided to allow users to try them out and provide feedback on functionality and API etc before they ship and get "carved in stone".
- You must enable the feature when invoking configure as otherwise curl will not be built with the feature present.
- We strongly advice against using this feature in production.
- We reserve the right to change behavior of the feature without sticking to our API/ABI rules as we do for regular features, as long as it is marked experimental.
- Experimental features are clearly marked so in documentation. Beware.
Enable Alt-Svc in build
./configure --enable-alt-svc
Standard
What works
- read alt-svc file from disk
- write alt-svc file from disk
- parse
Alt-Svc:
response headers, includingma
,clear
andpersist
. - replaces old entries when new alternatives are received
- unit tests to verify most of this functionality (test 1654)
- act on
Alt-Svc:
response headers - build conditionally on
configure --enable-alt-svc
only, feature marked as EXPERIMENTAL - implement
CURLOPT_ALTSVC_CTRL
- implement
CURLOPT_ALTSVC
- document
CURLOPT_ALTSVC_CTRL
- document
CURLOPT_ALTSVC
- document
--alt-svc
- add
CURL_VERSION_ALTSVC
- make
curl -V
show 'alt-svc' as a feature if built-in - support
curl --alt-svc [file]
to enable caching, using that file - make
tests/runtests.pl
able to filter tests on the featurealt-svc
- actually use the existing in-memory alt-svc cache for outgoing connections
- alt-svc cache expiry
- test 355 and 356 verify curl acting on Alt-Svc, received from header and loaded from cache. The latter needs a debug build since it enables Alt-Svc for plain HTTP.
What is left
- handle multiple response headers, when one of them says
clear
(should override them all) - using
Age:
value for caching age as per spec CURLALTSVC_IMMEDIATELY
supportCURLALTSVC_ALTUSED
support
Alt-Svc cache file format
This a text based file with one line per entry and each line consists of nine space separated fields.
Example
h2 quic.tech 8443 h3-22 quic.tech 8443 "20190808 06:18:37" 0 0
Fields
- The ALPN id for the source origin
- The host name for the source origin
- The port number for the source origin
- The ALPN id for the destination host
- The host name for the destination host
- The host number for the destination host
- Within double quotes, the expiration date of this entry
- Boolean (1 or 0) if "persist" was set for this entry
- Integer priority value (not currently used)