1*6236dae4SAndroid Build Coastguard Worker--- 2*6236dae4SAndroid Build Coastguard Workerc: Copyright (C) Daniel Stenberg, <[email protected]>, et al. 3*6236dae4SAndroid Build Coastguard WorkerSPDX-License-Identifier: curl 4*6236dae4SAndroid Build Coastguard WorkerTitle: CURLOPT_PROXYUSERNAME 5*6236dae4SAndroid Build Coastguard WorkerSection: 3 6*6236dae4SAndroid Build Coastguard WorkerSource: libcurl 7*6236dae4SAndroid Build Coastguard WorkerSee-also: 8*6236dae4SAndroid Build Coastguard Worker - CURLOPT_HTTPAUTH (3) 9*6236dae4SAndroid Build Coastguard Worker - CURLOPT_PROXYAUTH (3) 10*6236dae4SAndroid Build Coastguard Worker - CURLOPT_PROXYPASSWORD (3) 11*6236dae4SAndroid Build Coastguard Worker - CURLOPT_USERNAME (3) 12*6236dae4SAndroid Build Coastguard WorkerProtocol: 13*6236dae4SAndroid Build Coastguard Worker - All 14*6236dae4SAndroid Build Coastguard WorkerAdded-in: 7.19.1 15*6236dae4SAndroid Build Coastguard Worker--- 16*6236dae4SAndroid Build Coastguard Worker 17*6236dae4SAndroid Build Coastguard Worker# NAME 18*6236dae4SAndroid Build Coastguard Worker 19*6236dae4SAndroid Build Coastguard WorkerCURLOPT_PROXYUSERNAME - username to use for proxy authentication 20*6236dae4SAndroid Build Coastguard Worker 21*6236dae4SAndroid Build Coastguard Worker# SYNOPSIS 22*6236dae4SAndroid Build Coastguard Worker 23*6236dae4SAndroid Build Coastguard Worker~~~c 24*6236dae4SAndroid Build Coastguard Worker#include <curl/curl.h> 25*6236dae4SAndroid Build Coastguard Worker 26*6236dae4SAndroid Build Coastguard WorkerCURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXYUSERNAME, 27*6236dae4SAndroid Build Coastguard Worker char *username); 28*6236dae4SAndroid Build Coastguard Worker~~~ 29*6236dae4SAndroid Build Coastguard Worker 30*6236dae4SAndroid Build Coastguard Worker# DESCRIPTION 31*6236dae4SAndroid Build Coastguard Worker 32*6236dae4SAndroid Build Coastguard WorkerPass a char pointer as parameter, which should be pointing to the 33*6236dae4SAndroid Build Coastguard Workernull-terminated username to use for the transfer. 34*6236dae4SAndroid Build Coastguard Worker 35*6236dae4SAndroid Build Coastguard WorkerCURLOPT_PROXYUSERNAME(3) sets the username to be used in protocol 36*6236dae4SAndroid Build Coastguard Workerauthentication with the proxy. 37*6236dae4SAndroid Build Coastguard Worker 38*6236dae4SAndroid Build Coastguard WorkerTo specify the proxy password use the CURLOPT_PROXYPASSWORD(3). 39*6236dae4SAndroid Build Coastguard Worker 40*6236dae4SAndroid Build Coastguard WorkerThe application does not have to keep the string around after setting this 41*6236dae4SAndroid Build Coastguard Workeroption. 42*6236dae4SAndroid Build Coastguard Worker 43*6236dae4SAndroid Build Coastguard Worker# DEFAULT 44*6236dae4SAndroid Build Coastguard Worker 45*6236dae4SAndroid Build Coastguard Workerblank 46*6236dae4SAndroid Build Coastguard Worker 47*6236dae4SAndroid Build Coastguard Worker# %PROTOCOLS% 48*6236dae4SAndroid Build Coastguard Worker 49*6236dae4SAndroid Build Coastguard Worker# EXAMPLE 50*6236dae4SAndroid Build Coastguard Worker 51*6236dae4SAndroid Build Coastguard Worker~~~c 52*6236dae4SAndroid Build Coastguard Workerint main(void) 53*6236dae4SAndroid Build Coastguard Worker{ 54*6236dae4SAndroid Build Coastguard Worker CURL *curl = curl_easy_init(); 55*6236dae4SAndroid Build Coastguard Worker if(curl) { 56*6236dae4SAndroid Build Coastguard Worker CURLcode res; 57*6236dae4SAndroid Build Coastguard Worker curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin"); 58*6236dae4SAndroid Build Coastguard Worker curl_easy_setopt(curl, CURLOPT_PROXY, "http://localhost:8080"); 59*6236dae4SAndroid Build Coastguard Worker curl_easy_setopt(curl, CURLOPT_PROXYUSERNAME, "mrsmith"); 60*6236dae4SAndroid Build Coastguard Worker curl_easy_setopt(curl, CURLOPT_PROXYPASSWORD, "qwerty"); 61*6236dae4SAndroid Build Coastguard Worker res = curl_easy_perform(curl); 62*6236dae4SAndroid Build Coastguard Worker curl_easy_cleanup(curl); 63*6236dae4SAndroid Build Coastguard Worker } 64*6236dae4SAndroid Build Coastguard Worker} 65*6236dae4SAndroid Build Coastguard Worker~~~ 66*6236dae4SAndroid Build Coastguard Worker 67*6236dae4SAndroid Build Coastguard Worker# %AVAILABILITY% 68*6236dae4SAndroid Build Coastguard Worker 69*6236dae4SAndroid Build Coastguard Worker# RETURN VALUE 70*6236dae4SAndroid Build Coastguard Worker 71*6236dae4SAndroid Build Coastguard WorkerReturns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or 72*6236dae4SAndroid Build Coastguard WorkerCURLE_OUT_OF_MEMORY if there was insufficient heap space. 73