xref: /aosp_15_r20/external/curl/docs/cmdline-opts/proxy-header.md (revision 6236dae45794135f37c4eb022389c904c8b0090d)
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 WorkerLong: proxy-header
5*6236dae4SAndroid Build Coastguard WorkerArg: <header/@file>
6*6236dae4SAndroid Build Coastguard WorkerHelp: Pass custom header(s) to proxy
7*6236dae4SAndroid Build Coastguard WorkerProtocols: HTTP
8*6236dae4SAndroid Build Coastguard WorkerAdded: 7.37.0
9*6236dae4SAndroid Build Coastguard WorkerCategory: proxy
10*6236dae4SAndroid Build Coastguard WorkerMulti: append
11*6236dae4SAndroid Build Coastguard WorkerSee-also:
12*6236dae4SAndroid Build Coastguard Worker  - proxy
13*6236dae4SAndroid Build Coastguard WorkerExample:
14*6236dae4SAndroid Build Coastguard Worker  - --proxy-header "X-First-Name: Joe" -x http://proxy $URL
15*6236dae4SAndroid Build Coastguard Worker  - --proxy-header "User-Agent: surprise" -x http://proxy $URL
16*6236dae4SAndroid Build Coastguard Worker  - --proxy-header "Host:" -x http://proxy $URL
17*6236dae4SAndroid Build Coastguard Worker---
18*6236dae4SAndroid Build Coastguard Worker
19*6236dae4SAndroid Build Coastguard Worker# `--proxy-header`
20*6236dae4SAndroid Build Coastguard Worker
21*6236dae4SAndroid Build Coastguard WorkerExtra header to include in the request when sending HTTP to a proxy. You may
22*6236dae4SAndroid Build Coastguard Workerspecify any number of extra headers. This is the equivalent option to --header
23*6236dae4SAndroid Build Coastguard Workerbut is for proxy communication only like in CONNECT requests when you want a
24*6236dae4SAndroid Build Coastguard Workerseparate header sent to the proxy to what is sent to the actual remote host.
25*6236dae4SAndroid Build Coastguard Worker
26*6236dae4SAndroid Build Coastguard Workercurl makes sure that each header you add/replace is sent with the proper
27*6236dae4SAndroid Build Coastguard Workerend-of-line marker, you should thus **not** add that as a part of the header
28*6236dae4SAndroid Build Coastguard Workercontent: do not add newlines or carriage returns, they only mess things up for
29*6236dae4SAndroid Build Coastguard Workeryou.
30*6236dae4SAndroid Build Coastguard Worker
31*6236dae4SAndroid Build Coastguard WorkerHeaders specified with this option are not included in requests that curl
32*6236dae4SAndroid Build Coastguard Workerknows are not be sent to a proxy.
33*6236dae4SAndroid Build Coastguard Worker
34*6236dae4SAndroid Build Coastguard WorkerThis option can take an argument in @filename style, which then adds a header
35*6236dae4SAndroid Build Coastguard Workerfor each line in the input file (added in 7.55.0). Using @- makes curl read
36*6236dae4SAndroid Build Coastguard Workerthe headers from stdin.
37*6236dae4SAndroid Build Coastguard Worker
38*6236dae4SAndroid Build Coastguard WorkerThis option can be used multiple times to add/replace/remove multiple headers.
39