CURLOPT_PROTOCOLS.3 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 1998 - 2014, 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_PROTOCOLS 3 "February 03, 2016" "libcurl 7.61.1" "curl_easy_setopt options"
  24. .SH NAME
  25. CURLOPT_PROTOCOLS \- set allowed protocols
  26. .SH SYNOPSIS
  27. #include <curl/curl.h>
  28. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROTOCOLS, long bitmask);
  29. .SH DESCRIPTION
  30. Pass a long that holds a bitmask of CURLPROTO_* defines. If used, this bitmask
  31. limits what protocols libcurl may use in the transfer. This allows you to have
  32. a libcurl built to support a wide range of protocols but still limit specific
  33. transfers to only be allowed to use a subset of them. By default libcurl will
  34. accept all protocols it supports (\fICURLPROTO_ALL\fP). See also
  35. \fICURLOPT_REDIR_PROTOCOLS(3)\fP.
  36. These are the available protocol defines:
  37. .nf
  38. CURLPROTO_DICT
  39. CURLPROTO_FILE
  40. CURLPROTO_FTP
  41. CURLPROTO_FTPS
  42. CURLPROTO_GOPHER
  43. CURLPROTO_HTTP
  44. CURLPROTO_HTTPS
  45. CURLPROTO_IMAP
  46. CURLPROTO_IMAPS
  47. CURLPROTO_LDAP
  48. CURLPROTO_LDAPS
  49. CURLPROTO_POP3
  50. CURLPROTO_POP3S
  51. CURLPROTO_RTMP
  52. CURLPROTO_RTMPE
  53. CURLPROTO_RTMPS
  54. CURLPROTO_RTMPT
  55. CURLPROTO_RTMPTE
  56. CURLPROTO_RTMPTS
  57. CURLPROTO_RTSP
  58. CURLPROTO_SCP
  59. CURLPROTO_SFTP
  60. CURLPROTO_SMB
  61. CURLPROTO_SMBS
  62. CURLPROTO_SMTP
  63. CURLPROTO_SMTPS
  64. CURLPROTO_TELNET
  65. CURLPROTO_TFTP
  66. .fi
  67. .SH DEFAULT
  68. All protocols built-in
  69. .SH PROTOCOLS
  70. All
  71. .SH EXAMPLE
  72. .nf
  73. curl = curl_easy_init();
  74. if(curl) {
  75. /* pass in the URL from an external source */
  76. curl_easy_setopt(curl, CURLOPT_URL, argv[1]);
  77. /* only allow HTTP, TFTP and SFTP */
  78. curl_easy_setopt(curl, CURLOPT_PROTOCOLS,
  79. CURLPROTO_HTTP | CURLPROTO_TFTP | CURLPROTO_SFTP);
  80. /* Perform the request */
  81. curl_easy_perform(curl);
  82. }
  83. .fi
  84. .SH AVAILABILITY
  85. Added in 7.19.4
  86. .SH RETURN VALUE
  87. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  88. .SH "SEE ALSO"
  89. .BR CURLOPT_REDIR_PROTOCOLS "(3), " CURLOPT_URL "(3), "