CURLOPT_ALTSVC.3 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. .\" generated by cd2nroff 0.1 from CURLOPT_ALTSVC.md
  2. .TH CURLOPT_ALTSVC 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_ALTSVC \- alt\-svc cache filename
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_ALTSVC, char *filename);
  9. .fi
  10. .SH DESCRIPTION
  11. Pass in a pointer to a \fIfilename\fP to instruct libcurl to use that file as
  12. the Alt\-Svc cache to read existing cache contents from and possibly also write
  13. it back to after a transfer, unless \fBCURLALTSVC_READONLYFILE\fP is set in
  14. \fICURLOPT_ALTSVC_CTRL(3)\fP.
  15. Specify a blank filename ("") to make libcurl not load from a file at all.
  16. .SH DEFAULT
  17. NULL. The alt\-svc cache is not read nor written to file.
  18. .SH PROTOCOLS
  19. This functionality affects http only
  20. .SH EXAMPLE
  21. .nf
  22. int main(void)
  23. {
  24. CURL *curl = curl_easy_init();
  25. if(curl) {
  26. curl_easy_setopt(curl, CURLOPT_ALTSVC_CTRL, CURLALTSVC_H1);
  27. curl_easy_setopt(curl, CURLOPT_ALTSVC, "altsvc-cache.txt");
  28. curl_easy_perform(curl);
  29. }
  30. }
  31. .fi
  32. .SH FILE FORMAT
  33. A text based file with one line per alt\-svc entry and each line consists of
  34. nine space\-separated fields.
  35. An example line could look like
  36. .nf
  37. h2 www.example.com 8443 h3 second.example.com 443 "20190808 06:18:37" 1 0
  38. .fi
  39. The fields of that line are:
  40. .IP h2
  41. ALPN id for the source origin
  42. .IP www.example.comp
  43. Hostname for the source origin
  44. .IP 8443
  45. Port number for the source origin
  46. .IP h3
  47. ALPN id for the destination host
  48. .IP second.example.com
  49. Hostname for the destination host
  50. .IP 443
  51. Port number for the destination host
  52. .IP 2019*
  53. Expiration date and time of this entry within double quotes. The date format
  54. is "YYYYMMDD HH:MM:SS" and the time zone is GMT.
  55. .IP 1
  56. Boolean (1 or 0) if "persist" was set for this entry
  57. .IP 0
  58. Integer priority value (not currently used)
  59. .SH AVAILABILITY
  60. Added in curl 7.64.1
  61. .SH RETURN VALUE
  62. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  63. .SH SEE ALSO
  64. .BR CURLOPT_ALTSVC_CTRL (3),
  65. .BR CURLOPT_CONNECT_TO (3),
  66. .BR CURLOPT_COOKIEFILE (3),
  67. .BR CURLOPT_RESOLVE (3)