CURLOPT_PROTOCOLS.3 3.0 KB

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