CURLOPT_PROTOCOLS.3 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. .\" generated by cd2nroff 0.1 from CURLOPT_PROTOCOLS.md
  2. .TH CURLOPT_PROTOCOLS 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_PROTOCOLS \- allowed protocols
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROTOCOLS, long bitmask);
  9. .fi
  10. .SH DESCRIPTION
  11. This option is deprecated. We strongly recommend using
  12. \fICURLOPT_PROTOCOLS_STR(3)\fP instead because this option cannot control all
  13. available protocols!
  14. Pass a long that holds a bitmask of CURLPROTO_* defines. If used, this bitmask
  15. limits what protocols libcurl may use in the transfer. This allows you to have
  16. a libcurl built to support a wide range of protocols but still limit specific
  17. transfers to only be allowed to use a subset of them. By default libcurl
  18. accepts all protocols it supports (\fICURLPROTO_ALL\fP). See also
  19. \fICURLOPT_REDIR_PROTOCOLS(3)\fP.
  20. These are the available protocol defines:
  21. .nf
  22. CURLPROTO_DICT
  23. CURLPROTO_FILE
  24. CURLPROTO_FTP
  25. CURLPROTO_FTPS
  26. CURLPROTO_GOPHER
  27. CURLPROTO_HTTP
  28. CURLPROTO_HTTPS
  29. CURLPROTO_IMAP
  30. CURLPROTO_IMAPS
  31. CURLPROTO_LDAP
  32. CURLPROTO_LDAPS
  33. CURLPROTO_POP3
  34. CURLPROTO_POP3S
  35. CURLPROTO_RTMP
  36. CURLPROTO_RTMPE
  37. CURLPROTO_RTMPS
  38. CURLPROTO_RTMPT
  39. CURLPROTO_RTMPTE
  40. CURLPROTO_RTMPTS
  41. CURLPROTO_RTSP
  42. CURLPROTO_SCP
  43. CURLPROTO_SFTP
  44. CURLPROTO_SMB
  45. CURLPROTO_SMBS
  46. CURLPROTO_SMTP
  47. CURLPROTO_SMTPS
  48. CURLPROTO_TELNET
  49. CURLPROTO_TFTP
  50. .fi
  51. .SH DEFAULT
  52. All protocols built\-in.
  53. .SH PROTOCOLS
  54. This functionality affects all supported protocols
  55. .SH EXAMPLE
  56. .nf
  57. int main(int argc, char **argv)
  58. {
  59. CURL *curl = curl_easy_init();
  60. if(curl) {
  61. /* pass in the URL from an external source */
  62. curl_easy_setopt(curl, CURLOPT_URL, argv[1]);
  63. /* only allow HTTP, TFTP and SFTP */
  64. curl_easy_setopt(curl, CURLOPT_PROTOCOLS,
  65. CURLPROTO_HTTP | CURLPROTO_TFTP | CURLPROTO_SFTP);
  66. /* Perform the request */
  67. curl_easy_perform(curl);
  68. }
  69. }
  70. .fi
  71. .SH DEPRECATED
  72. Deprecated since 7.85.0.
  73. .SH AVAILABILITY
  74. Added in curl 7.19.4
  75. .SH RETURN VALUE
  76. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  77. .SH SEE ALSO
  78. .BR CURLOPT_DEFAULT_PROTOCOL (3),
  79. .BR CURLOPT_REDIR_PROTOCOLS (3),
  80. .BR CURLOPT_URL (3)