]> granicus.if.org Git - curl/commitdiff
opts: more examples added to man pages
authorDaniel Stenberg <daniel@haxx.se>
Tue, 30 May 2017 21:35:30 +0000 (23:35 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 30 May 2017 21:35:30 +0000 (23:35 +0200)
19 files changed:
docs/libcurl/opts/CURLOPT_FAILONERROR.3
docs/libcurl/opts/CURLOPT_FTPPORT.3
docs/libcurl/opts/CURLOPT_HEADEROPT.3
docs/libcurl/opts/CURLOPT_HTTPAUTH.3
docs/libcurl/opts/CURLOPT_HTTP_VERSION.3
docs/libcurl/opts/CURLOPT_MAXCONNECTS.3
docs/libcurl/opts/CURLOPT_MAXFILESIZE.3
docs/libcurl/opts/CURLOPT_MAXFILESIZE_LARGE.3
docs/libcurl/opts/CURLOPT_MAX_RECV_SPEED_LARGE.3
docs/libcurl/opts/CURLOPT_MAX_SEND_SPEED_LARGE.3
docs/libcurl/opts/CURLOPT_NOPROXY.3
docs/libcurl/opts/CURLOPT_PROXYAUTH.3
docs/libcurl/opts/CURLOPT_PROXYHEADER.3
docs/libcurl/opts/CURLOPT_PROXYPASSWORD.3
docs/libcurl/opts/CURLOPT_PROXYTYPE.3
docs/libcurl/opts/CURLOPT_PROXYUSERNAME.3
docs/libcurl/opts/CURLOPT_PROXYUSERPWD.3
docs/libcurl/opts/CURLOPT_PROXY_CAINFO.3
docs/libcurl/opts/CURLOPT_PROXY_CAPATH.3

index 93d8ba6ed0f85df38ff3493eaa10e8c36304a2ea..451b07cad2f3e1cb3b88cacf019284d0d3f429ab 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -41,15 +41,26 @@ detected, like when a "100-continue" is received as a response to a POST/PUT
 and a 401 or 407 is received immediately afterwards.
 
 When this option is used and an error is detected, it will cause the
-connection to get closed.
+connection to get closed and \fICURLE_HTTP_RETURNED_ERROR\fP is returned.
 .SH DEFAULT
 0, do not fail on error
 .SH PROTOCOLS
 HTTP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  CURLcode ret;
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1L);
+  ret = curl_easy_perform(curl);
+  if(ret == CURLE_HTTP_RETURNED_ERROR) {
+    /* a HTTP response error problem */
+  }
+}
+.fi
 .SH AVAILABILITY
-Along with HTTP 
+Along with HTTP.
 .SH RETURN VALUE
 Returns CURLE_OK if HTTP is enabled, and CURLE_UNKNOWN_OPTION if not.
 .SH "SEE ALSO"
index 0f2a9f7f93e8ca049cac391f517b233b2abd8b8e..e150a5b295957c0d7466101bed9a859e8ce3d1ec 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -65,7 +65,15 @@ NULL
 .SH PROTOCOLS
 FTP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/old-server/file.txt");
+  curl_easy_setopt(curl, CURLOPT_FTPPORT, "-");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Port range support was added in 7.19.5
 .SH RETURN VALUE
index 7053a3af25d92a559ab2e7168cb9850a5be26985..ff9070e743624d870403f2d1dabd8c0c2b17484e 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -48,7 +48,24 @@ CURLHEADER_SEPARATE (changed in 7.42.1, ased CURLHEADER_UNIFIED before then)
 .SH PROTOCOLS
 HTTP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  CURLcode ret;
+  struct curl_slist *list;
+  list = curl_slist_append(NULL, "Shoesize: 10");
+  list = curl_slist_append(list, "Accept:");
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_PROXY, "http://localhost:8080");
+
+  /* HTTPS over a proxy makes a separate CONNECT to the proxy, so tell
+     libcurl to not send the custom headers to the proxy. Keep them
+     separate! */
+  curl_easy_setopt(curl, CURLOPT_HEADEROPT, CURLHEADER_SEPARATE);
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.37.0
 .SH RETURN VALUE
index fc7a3a41a6f4b51ff4f2c4acffda2973162634aa..8a5ae4143afe5d7b4ebc28f34020f157176e88ea 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -99,7 +99,17 @@ CURLAUTH_BASIC
 .SH PROTOCOLS
 HTTP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  CURLcode ret;
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  /* allow whatever auth the server speaks */
+  curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
+  curl_easy_setopt(curl, CURLOPT_USERPWD, "james:bond");
+  ret = curl_easy_perform(curl);
+}
+.fi
 .SH AVAILABILITY
 Option Added in 7.10.6.
 
index 96dd4b6729041fb3d73376f64ea1743754c00c54..e602b031129d7f2dcdb9eeb1a57b4934ee700f21 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -64,7 +64,18 @@ CURL_HTTP_VERSION_NONE
 .SH PROTOCOLS
 HTTP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  CURLcode ret;
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2TLS);
+  ret = curl_easy_perform(curl);
+  if(ret == CURLE_HTTP_RETURNED_ERROR) {
+    /* a HTTP response error problem */
+  }
+}
+.fi
 .SH AVAILABILITY
 Along with HTTP
 .SH RETURN VALUE
index 8e90a9d268e8f5de1913a22f262d8aa21281f5a8..b60517175c8820e85873bcae5fcae738af6552be 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -50,7 +50,16 @@ acknowledged, and you must instead use \fIcurl_multi_setopt(3)\fP and the
 .SH PROTOCOLS
 Most
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  CURLcode ret;
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  /* limit the connection cache for this handle to no more than 3 */
+  curl_easy_setopt(curl, CURLOPT_MAXCONNECTS, 3L);
+  ret = curl_easy_perform(curl);
+}
+.fi
 .SH AVAILABILITY
 Always
 .SH RETURN VALUE
index 5f5959a179ade50cda9bf1b69be29f954f252c47..b75e66df70519858a8191210f9772b570604dba1 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -43,7 +43,16 @@ None
 .SH PROTOCOLS
 FTP and HTTP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  CURLcode ret;
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  /* refuse to download if larger than 1000 bytes! */
+  curl_easy_setopt(curl, CURLOPT_MAXFILESIZE, 1000L);
+  ret = curl_easy_perform(curl);
+}
+.fi
 .SH AVAILABILITY
 Always
 .SH RETURN VALUE
index 630c0b5ab69a8b89e92d97f19809e1e5c2d8461b..969cc5f2c6afa2566954ab3a88908ea60d8cb097 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -43,7 +43,17 @@ None
 .SH PROTOCOLS
 FTP and HTTP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  CURLcode ret;
+  curl_off_t ridiculous = 1 << 48;
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  /* refuse to download if larger than ridiculous */
+  curl_easy_setopt(curl, CURLOPT_MAXFILESIZE_LARGE, ridiculous);
+  ret = curl_easy_perform(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.11.0
 .SH RETURN VALUE
index c99ff61e3712f03d3e3fe091cdede0ab939ca530..e4ced8643a740a2b202da75ce8b1fbe23fc36508 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -40,6 +40,16 @@ This option doesn't affect transfer speeds done with FILE:// URLs.
 .SH PROTOCOLS
 All but file://
 .SH EXAMPLE
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  CURLcode ret;
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  /* cap the download speed to 31415 bytes/sec */
+  curl_easy_setopt(curl, CURLOPT_MAX_RECV_SPEED_LARGE, (curl_off_t)31415);
+  ret = curl_easy_perform(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.15.5
 .SH RETURN VALUE
index 7f3efe57cf483eb674c8450fa9d4a0fded41aea5..d9f5c8bf03dbca808688a80a5780fc12f7c18d7a 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -41,7 +41,17 @@ This option doesn't affect transfer speeds done with FILE:// URLs.
 .SH PROTOCOLS
 All except file://
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  CURLcode ret;
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  /* cap the upload speed to 1000 bytes/sec */
+  curl_easy_setopt(curl, CURLOPT_MAX_SEND_SPEED_LARGE, (curl_off_t)1000);
+  /* (set some upload options as well!) */
+  ret = curl_easy_perform(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.15.5
 .SH RETURN VALUE
index a969dc5c217ec442a6fb9bb533132eb764852933..a1ee476f6d7bc50bcfd1897b554e7f4cb6625309 100644 (file)
@@ -48,7 +48,18 @@ NULL
 .SH PROTOCOLS
 Most
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  /* accept various URLs */
+  curl_easy_setopt(curl, CURLOPT_URL, input);
+  /* use this proxy */
+  curl_easy_setopt(curl, CURLOPT_PROXY, "http://proxy:80");
+  /* ... but make sure this host name is not proxied */
+  curl_easy_setopt(curl, CURLOPT_NOPROXY, "www.example.com");
+  curl_easy_perform(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.19.4
 .SH RETURN VALUE
index 24dbca5ab54eea961e0e3bc347342dae5fa559d5..fbf9414301add4351a61e2137721005d58e9418f 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -43,7 +43,21 @@ CURLAUTH_BASIC
 .SH PROTOCOLS
 HTTP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  CURLcode ret;
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  /* use this proxy */
+  curl_easy_setopt(curl, CURLOPT_PROXY, "http://local.example.com:1080");
+  /* allow whatever auth the proxy speaks */
+  curl_easy_setopt(curl, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
+  /* set the proxy credentials */
+  curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, "james:007");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.10.7
 .SH RETURN VALUE
index bfec6293e158bc8fbd575e680d88ea1756487e26..44ed85ecef7217e9c50d566ad529f52a99dcaf12 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -48,7 +48,25 @@ NULL
 .SH PROTOCOLS
 HTTP
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+
+struct curl_slist *list;
+
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
+  curl_easy_setopt(curl, CURLOPT_PROXY, "http://proxy.example.com:80");
+
+  list = curl_slist_append(NULL, "Shoesize: 10");
+  list = curl_slist_append(list, "Accept:");
+
+  curl_easy_setopt(curl, CURLOPT_PROXYHEADER, list);
+
+  curl_easy_perform(curl);
+
+  curl_slist_free_all(list); /* free the list again */
+}
+.fi
 .SH AVAILABILITY
 Added in 7.37.0
 .SH RETURN VALUE
index c7fbb179ee0e417a6d93ce6c75f4cf3dd9aa39d2..75b2b7df33bb072ae992d92eb96af4a61dc3c732 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -41,7 +41,17 @@ blank
 .SH PROTOCOLS
 Most
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
+  curl_easy_setopt(curl, CURLOPT_PROXY, "http://localhost:8080");
+  curl_easy_setopt(curl, CURLOPT_PROXYUSERNAME, "mrsmith");
+  curl_easy_setopt(curl, CURLOPT_PROXYPASSWORD, "qwerty");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.19.1
 .SH RETURN VALUE
index 19856195eb5af49de6c77bff43969d0ec42e377a..d7d97504e5856361f671a8c4edf97aad982b0b64 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -56,7 +56,18 @@ CURLPROXY_HTTP
 .SH PROTOCOLS
 Most
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  CURLcode ret;
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  curl_easy_setopt(curl, CURLOPT_PROXY, "local.example.com:1080");
+  /* set the proxy type */
+  curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Always
 .SH RETURN VALUE
index 46ecac6bfe8f723523a80a875aba72ce0132f2c5..54981b124c56b5a8ddaaaabcdaf180793510b795 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -45,7 +45,17 @@ blank
 .SH PROTOCOLS
 Most
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
+  curl_easy_setopt(curl, CURLOPT_PROXY, "http://localhost:8080");
+  curl_easy_setopt(curl, CURLOPT_PROXYUSERNAME, "mrsmith");
+  curl_easy_setopt(curl, CURLOPT_PROXYPASSWORD, "qwerty");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.19.1
 .SH RETURN VALUE
index ebfcfcc99f41fb9ad499026fb8363ed2bbdfeae0..cdf4e088504ab4cc2525934e5b68c8ca6d05059b 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -43,7 +43,16 @@ This is NULL by default.
 .SH PROTOCOLS
 Used with all protocols that can use a proxy
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
+  curl_easy_setopt(curl, CURLOPT_PROXY, "http://localhost:8080");
+  curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, "clark%20kent:superman");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Always
 .SH RETURN VALUE
index 43bc32b5bb037f56a3625d3fc2a789f3a679e0af..a5f61a5bdb0fef10e95c9a3974f2f8567dc4e6ef 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -56,7 +56,17 @@ Built-in system specific
 .SH PROTOCOLS
 Used with HTTPS proxy
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  /* using a HTTPS proxy */
+  curl_easy_setopt(curl, CURLOPT_PROXY, "https://localhost:443");
+  curl_easy_setopt(curl, CURLOPT_PROXY_CAINFO, "/etc/certs/cabundle.pem");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.52.0
 
index dc317f03b96a9ed32c7cae341f14a9c454d64fc2..4064dfd85f29043b0174b83863f55382560ca8d1 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -31,8 +31,8 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_CAPATH, char *capath);
 Pass a char * to a zero terminated string naming a directory holding multiple
 CA certificates to verify the HTTPS proxy with. If libcurl is built against
 OpenSSL, the certificate directory must be prepared using the openssl c_rehash
-utility. This makes sense only when \fICURLOPT_SSL_VERIFYPEER(3)\fP is enabled
-(which it is by default).
+utility. This makes sense only when \fICURLOPT_PROXY_SSL_VERIFYPEER(3)\fP is
+enabled (which it is by default).
 
 The application does not have to keep the string around after setting this
 option.
@@ -41,7 +41,17 @@ NULL
 .SH PROTOCOLS
 Everything used over an HTTPS proxy
 .SH EXAMPLE
-TODO
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
+  /* using a HTTPS proxy */
+  curl_easy_setopt(curl, CURLOPT_PROXY, "https://localhost:443");
+  curl_easy_setopt(curl, CURLOPT_PROXY_CAPATH, "/etc/cert-dir");
+  ret = curl_easy_perform(curl);
+  curl_easy_cleanup(curl);
+}
+.fi
 .SH AVAILABILITY
 Added in 7.52.0
 
@@ -56,5 +66,6 @@ CURLE_UNKNOWN_OPTION
 
 CURLE_OUT_OF_MEMORY
 .SH "SEE ALSO"
-.BR CURLOPT_CAINFO "(3), "
+.BR CURLOPT_PROXY_CAINFO "(3), "
+.Br CURLOPT_CAINFO "(3), " CURLOPT_PROXY_SSL_VERIFYHOST "(3), "
 .BR CURLOPT_STDERR "(3), " CURLOPT_DEBUGFUNCTION "(3), "