1CURLOPT_ALTSVC(3) curl_easy_setopt options CURLOPT_ALTSVC(3)
2
3
4
6 CURLOPT_ALTSVC - set alt-svc cache file name
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_ALTSVC, char *filename);
12
14 Warning: this feature is early code and is marked as experimental. It
15 can only be enabled by explicitly telling configure with --enable-alt-
16 svc. You are advised to not ship this in production before the experi‐
17 mental label is removed.
18
20 Pass in a pointer to a filename to instruct libcurl to use that file as
21 the Alt-Svc cache to read existing cache contents from and possibly
22 also write it back to a after a transfer, unless CURLALTSVC_READONLY‐
23 FILE is set in CURLOPT_ALTSVC_CTRL(3).
24
25 Specify a blank file name ("") to make libcurl not load from a file at
26 all.
27
29 NULL. The alt-svc cache is not read nor written to file.
30
32 HTTPS
33
35 CURL *curl = curl_easy_init();
36 if(curl) {
37 curl_easy_setopt(curl, CURLOPT_ALTSVC_CTRL, CURLALTSVC_H1);
38 curl_easy_setopt(curl, CURLOPT_ALTSVC, "altsvc-cache.txt");
39 curl_easy_perform(curl);
40 }
41
43 Added in 7.64.1
44
46 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION
47 if not.
48
50 CURLOPT_ALTSVC_CTRL(3), CURLOPT_CONNECT_TO(3), CURLOPT_RESOLVE(3), CUR‐
51 LOPT_COOKIEFILE(3),
52
53
54
55libcurl 7.69.1 August 14, 2019 CURLOPT_ALTSVC(3)