1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_PROXYPASSWORD
5Section: 3
6Source: libcurl
7See-also:
8  - CURLOPT_HTTPAUTH (3)
9  - CURLOPT_PASSWORD (3)
10  - CURLOPT_PROXYAUTH (3)
11  - CURLOPT_PROXYUSERNAME (3)
12Protocol:
13  - All
14Added-in: 7.19.1
15---
16
17# NAME
18
19CURLOPT_PROXYPASSWORD - password to use with proxy authentication
20
21# SYNOPSIS
22
23~~~c
24#include <curl/curl.h>
25
26CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXYPASSWORD, char *pwd);
27~~~
28
29# DESCRIPTION
30
31Pass a char pointer as parameter, which should be pointing to the
32null-terminated password to use for authentication with the proxy.
33
34The CURLOPT_PROXYPASSWORD(3) option should be used in conjunction with the
35CURLOPT_PROXYUSERNAME(3) option.
36
37The application does not have to keep the string around after setting this
38option.
39
40Using this option multiple times makes the last set string override the
41previous ones. Set it to NULL to disable its use again.
42
43# DEFAULT
44
45blank
46
47# %PROTOCOLS%
48
49# EXAMPLE
50
51~~~c
52int main(void)
53{
54  CURL *curl = curl_easy_init();
55  if(curl) {
56    CURLcode res;
57    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
58    curl_easy_setopt(curl, CURLOPT_PROXY, "http://localhost:8080");
59    curl_easy_setopt(curl, CURLOPT_PROXYUSERNAME, "mrsmith");
60    curl_easy_setopt(curl, CURLOPT_PROXYPASSWORD, "qwerty");
61    res = curl_easy_perform(curl);
62    curl_easy_cleanup(curl);
63  }
64}
65~~~
66
67# %AVAILABILITY%
68
69# RETURN VALUE
70
71Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or
72CURLE_OUT_OF_MEMORY if there was insufficient heap space.
73