2
0

CURLOPT_ALTSVC.3 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  9. .\" *
  10. .\" * This software is licensed as described in the file COPYING, which
  11. .\" * you should have received as part of this distribution. The terms
  12. .\" * are also available at https://curl.se/docs/copyright.html.
  13. .\" *
  14. .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. .\" * copies of the Software, and permit persons to whom the Software is
  16. .\" * furnished to do so, under the terms of the COPYING file.
  17. .\" *
  18. .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. .\" * KIND, either express or implied.
  20. .\" *
  21. .\" * SPDX-License-Identifier: curl
  22. .\" *
  23. .\" **************************************************************************
  24. .\"
  25. .TH CURLOPT_ALTSVC 3 "5 Feb 2019" libcurl libcurl
  26. .SH NAME
  27. CURLOPT_ALTSVC \- alt-svc cache file name
  28. .SH SYNOPSIS
  29. .nf
  30. #include <curl/curl.h>
  31. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_ALTSVC, char *filename);
  32. .fi
  33. .SH DESCRIPTION
  34. Pass in a pointer to a \fIfilename\fP to instruct libcurl to use that file as
  35. the Alt-Svc cache to read existing cache contents from and possibly also write
  36. it back to after a transfer, unless \fBCURLALTSVC_READONLYFILE\fP is set in
  37. \fICURLOPT_ALTSVC_CTRL(3)\fP.
  38. Specify a blank file name ("") to make libcurl not load from a file at all.
  39. .SH DEFAULT
  40. NULL. The alt-svc cache is not read nor written to file.
  41. .SH PROTOCOLS
  42. HTTPS
  43. .SH EXAMPLE
  44. .nf
  45. CURL *curl = curl_easy_init();
  46. if(curl) {
  47. curl_easy_setopt(curl, CURLOPT_ALTSVC_CTRL, CURLALTSVC_H1);
  48. curl_easy_setopt(curl, CURLOPT_ALTSVC, "altsvc-cache.txt");
  49. curl_easy_perform(curl);
  50. }
  51. .fi
  52. .SH "FILE FORMAT"
  53. A text based file with one line per alt-svc entry and each line consists of
  54. nine space-separated fields.
  55. An example line could look like
  56. h2 www.example 8443 h3 second.example 443 "20190808 06:18:37" 1 0
  57. The fields of that line are:
  58. .IP h2
  59. ALPN id for the source origin
  60. .IP www.example
  61. Host name for the source origin
  62. .IP 8443
  63. Port number for the source origin
  64. .IP h3
  65. ALPN id for the destination host
  66. .IP second.example
  67. Host name for the destination host
  68. .IP 443
  69. Port number for the destination host
  70. .IP 2019*
  71. Expiration date and time of this entry within double quotes. The date format
  72. is "YYYYMMDD HH:MM:SS" and the time zone is GMT.
  73. .IP 1
  74. Boolean (1 or 0) if "persist" was set for this entry
  75. .IP 0
  76. Integer priority value (not currently used)
  77. .SH AVAILABILITY
  78. Added in 7.64.1
  79. .SH RETURN VALUE
  80. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  81. .SH "SEE ALSO"
  82. .BR CURLOPT_ALTSVC_CTRL "(3), " CURLOPT_CONNECT_TO "(3), " CURLOPT_RESOLVE "(3), "
  83. .BR CURLOPT_COOKIEFILE "(3), "