xref: /aosp_15_r20/external/curl/docs/cmdline-opts/preproxy.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: preproxy
5*6236dae4SAndroid Build Coastguard WorkerArg: [protocol://]host[:port]
6*6236dae4SAndroid Build Coastguard WorkerHelp: Use this proxy first
7*6236dae4SAndroid Build Coastguard WorkerAdded: 7.52.0
8*6236dae4SAndroid Build Coastguard WorkerCategory: proxy
9*6236dae4SAndroid Build Coastguard WorkerMulti: single
10*6236dae4SAndroid Build Coastguard WorkerSee-also:
11*6236dae4SAndroid Build Coastguard Worker  - proxy
12*6236dae4SAndroid Build Coastguard Worker  - socks5
13*6236dae4SAndroid Build Coastguard WorkerExample:
14*6236dae4SAndroid Build Coastguard Worker  - --preproxy socks5://proxy.example -x http://http.example $URL
15*6236dae4SAndroid Build Coastguard Worker---
16*6236dae4SAndroid Build Coastguard Worker
17*6236dae4SAndroid Build Coastguard Worker# `--preproxy`
18*6236dae4SAndroid Build Coastguard Worker
19*6236dae4SAndroid Build Coastguard WorkerUse the specified SOCKS proxy before connecting to an HTTP or HTTPS --proxy. In
20*6236dae4SAndroid Build Coastguard Workersuch a case curl first connects to the SOCKS proxy and then connects (through
21*6236dae4SAndroid Build Coastguard WorkerSOCKS) to the HTTP or HTTPS proxy. Hence pre proxy.
22*6236dae4SAndroid Build Coastguard Worker
23*6236dae4SAndroid Build Coastguard WorkerThe pre proxy string should be specified with a protocol:// prefix to specify
24*6236dae4SAndroid Build Coastguard Workeralternative proxy protocols. Use socks4://, socks4a://, socks5:// or
25*6236dae4SAndroid Build Coastguard Workersocks5h:// to request the specific SOCKS version to be used. No protocol
26*6236dae4SAndroid Build Coastguard Workerspecified makes curl default to SOCKS4.
27*6236dae4SAndroid Build Coastguard Worker
28*6236dae4SAndroid Build Coastguard WorkerIf the port number is not specified in the proxy string, it is assumed to be
29*6236dae4SAndroid Build Coastguard Worker1080.
30*6236dae4SAndroid Build Coastguard Worker
31*6236dae4SAndroid Build Coastguard WorkerUser and password that might be provided in the proxy string are URL decoded
32*6236dae4SAndroid Build Coastguard Workerby curl. This allows you to pass in special characters such as @ by using %40
33*6236dae4SAndroid Build Coastguard Workeror pass in a colon with %3a.
34