2024-03-31 17:52:28 +08:00
|
|
|
<!--
|
|
|
|
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
|
|
|
|
|
|
|
SPDX-License-Identifier: curl
|
|
|
|
-->
|
|
|
|
|
2019-03-03 18:17:52 +08:00
|
|
|
# Alt-Svc
|
|
|
|
|
2020-10-26 06:08:54 +08:00
|
|
|
curl features support for the Alt-Svc: HTTP header.
|
2019-03-03 18:17:52 +08:00
|
|
|
|
|
|
|
## Enable Alt-Svc in build
|
|
|
|
|
|
|
|
`./configure --enable-alt-svc`
|
|
|
|
|
2020-10-26 06:08:54 +08:00
|
|
|
(enabled by default since 7.73.0)
|
|
|
|
|
2019-03-03 18:17:52 +08:00
|
|
|
## Standard
|
|
|
|
|
2022-01-22 02:52:33 +08:00
|
|
|
[RFC 7838](https://datatracker.ietf.org/doc/html/rfc7838)
|
2019-03-03 18:17:52 +08:00
|
|
|
|
2019-08-07 20:18:42 +08:00
|
|
|
# Alt-Svc cache file format
|
|
|
|
|
2022-09-28 00:53:54 +08:00
|
|
|
This is a text based file with one line per entry and each line consists of nine
|
2019-08-07 20:18:42 +08:00
|
|
|
space separated fields.
|
|
|
|
|
|
|
|
## Example
|
|
|
|
|
|
|
|
h2 quic.tech 8443 h3-22 quic.tech 8443 "20190808 06:18:37" 0 0
|
|
|
|
|
|
|
|
## Fields
|
|
|
|
|
|
|
|
1. The ALPN id for the source origin
|
2024-01-23 22:12:09 +08:00
|
|
|
2. The hostname for the source origin
|
2019-08-07 20:18:42 +08:00
|
|
|
3. The port number for the source origin
|
|
|
|
4. The ALPN id for the destination host
|
2024-01-23 22:12:09 +08:00
|
|
|
5. The hostname for the destination host
|
2024-02-03 01:51:19 +08:00
|
|
|
6. The port number for the destination host
|
2019-11-28 19:57:58 +08:00
|
|
|
7. The expiration date and time of this entry within double quotes. The date format is "YYYYMMDD HH:MM:SS" and the time zone is GMT.
|
2019-08-07 20:18:42 +08:00
|
|
|
8. Boolean (1 or 0) if "persist" was set for this entry
|
|
|
|
9. Integer priority value (not currently used)
|
2019-08-07 20:52:28 +08:00
|
|
|
|
2024-01-23 22:12:09 +08:00
|
|
|
If the hostname is an IPv6 numerical address, it is stored with brackets such
|
2023-08-27 06:06:02 +08:00
|
|
|
as `[::1]`.
|
|
|
|
|
2019-08-07 20:52:28 +08:00
|
|
|
# TODO
|
|
|
|
|
|
|
|
- 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` support
|