1--- 2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3SPDX-License-Identifier: curl 4Title: CURLOPT_PROXYHEADER 5Section: 3 6Source: libcurl 7See-also: 8 - CURLOPT_HEADEROPT (3) 9 - CURLOPT_HTTPHEADER (3) 10Protocol: 11 - All 12--- 13 14# NAME 15 16CURLOPT_PROXYHEADER - set of HTTP headers to pass to proxy 17 18# SYNOPSIS 19 20~~~c 21#include <curl/curl.h> 22 23CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXYHEADER, 24 struct curl_slist *headers); 25~~~ 26 27# DESCRIPTION 28 29Pass a pointer to a linked list of HTTP headers to pass in your HTTP request 30sent to a proxy. The rules for this list is identical to the 31CURLOPT_HTTPHEADER(3) option's. 32 33The headers set with this option is only ever used in requests sent to a proxy 34- when there is also a request sent to a host. 35 36The first line in a request (containing the method, usually a GET or POST) is 37NOT a header and cannot be replaced using this option. Only the lines 38following the request-line are headers. Adding this method line in this list 39of headers causes your request to send an invalid header. 40 41Pass a NULL to this to reset back to no custom headers. 42 43# DEFAULT 44 45NULL 46 47# EXAMPLE 48 49~~~c 50int main(void) 51{ 52 CURL *curl = curl_easy_init(); 53 54 struct curl_slist *list; 55 56 if(curl) { 57 curl_easy_setopt(curl, CURLOPT_URL, "https://example.com"); 58 curl_easy_setopt(curl, CURLOPT_PROXY, "http://proxy.example.com:80"); 59 60 list = curl_slist_append(NULL, "Shoesize: 10"); 61 list = curl_slist_append(list, "Accept:"); 62 63 curl_easy_setopt(curl, CURLOPT_PROXYHEADER, list); 64 65 curl_easy_perform(curl); 66 67 curl_slist_free_all(list); /* free the list again */ 68 } 69} 70~~~ 71 72# AVAILABILITY 73 74Added in 7.37.0 75 76# RETURN VALUE 77 78Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. 79