CURLOPT_DOH_URL.3 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 2018, 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.haxx.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. .\" **************************************************************************
  22. .\"
  23. .TH CURLOPT_DOH_URL 3 "18 Jun 2018" "libcurl 7.62.0" "curl_easy_setopt options"
  24. .SH NAME
  25. CURLOPT_DOH_URL \- provide the DNS-over-HTTPS URL
  26. .SH SYNOPSIS
  27. #include <curl/curl.h>
  28. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_DOH_URL, char *URL);
  29. .SH DESCRIPTION
  30. Pass in a pointer to a \fIURL\fP for the DOH server to use for name
  31. resolving. The parameter should be a char * to a zero terminated string which
  32. must be URL-encoded in the following format: "https://host:port/path". It MUST
  33. specify a HTTPS URL.
  34. libcurl doesn't validate the syntax or use this variable until the transfer is
  35. issued. Even if you set a crazy value here, \fIcurl_easy_setopt(3)\fP will
  36. still return \fICURLE_OK\fP.
  37. curl sends POST requests to the given DNS-over-HTTPS URL.
  38. To find the DOH server itself, which might be specified using a name, libcurl
  39. will use the default name lookup function. You can bootstrap that by providing
  40. the address for the DOH server with \fICURLOPT_RESOLVE(3)\fP.
  41. Disable DOH use again by setting this option to NULL.
  42. .SH DEFAULT
  43. NULL - there is no default DOH URL. If this option isn't set, libcurl will use
  44. the default name resolver.
  45. .SH PROTOCOLS
  46. All
  47. .SH EXAMPLE
  48. .nf
  49. CURL *curl = curl_easy_init();
  50. if(curl) {
  51. curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
  52. curl_easy_setopt(curl, CURLOPT_DOH_URL, "https://dns.example.com");
  53. curl_easy_perform(curl);
  54. }
  55. .fi
  56. .SH AVAILABILITY
  57. Added in 7.62.0
  58. .SH RETURN VALUE
  59. Returns CURLE_OK on success or CURLE_OUT_OF_MEMORY if there was insufficient
  60. heap space.
  61. Note that \fIcurl_easy_setopt(3)\fP won't actually parse the given string so
  62. given a bad DOH URL, curl will not detect a problem until it tries to resolve
  63. a name with it.
  64. .SH "SEE ALSO"
  65. .BR CURLOPT_VERBOSE "(3), " CURLOPT_RESOLVE "(3), "