xref: /curl/docs/cmdline-opts/proxy.md (revision 1160380e)
1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Long: proxy
5Short: x
6Arg: [protocol://]host[:port]
7Help: Use this proxy
8Category: proxy
9Added: 4.0
10Multi: single
11See-also:
12  - socks5
13  - proxy-basic
14Example:
15  - --proxy http://proxy.example $URL
16---
17
18# `--proxy`
19
20Use the specified proxy.
21
22The proxy string can be specified with a protocol:// prefix. No protocol
23specified or http:// it is treated as an HTTP proxy. Use socks4://,
24socks4a://, socks5:// or socks5h:// to request a specific SOCKS version to be
25used.  (Added in 7.21.7)
26
27Unix domain sockets are supported for socks proxy. Set localhost for the host
28part. e.g. socks5h://localhost/path/to/socket.sock
29
30HTTPS proxy support works set with the https:// protocol prefix for OpenSSL
31and GnuTLS (added in 7.52.0). It also works for BearSSL, mbedTLS, Rustls,
32Schannel, Secure Transport and wolfSSL (added in 7.87.0).
33
34Unrecognized and unsupported proxy protocols cause an error (added in 7.52.0).
35Ancient curl versions ignored unknown schemes and used http:// instead.
36
37If the port number is not specified in the proxy string, it is assumed to be
381080.
39
40This option overrides existing environment variables that set the proxy to
41use. If there is an environment variable setting a proxy, you can set proxy to
42"" to override it.
43
44All operations that are performed over an HTTP proxy are transparently
45converted to HTTP. It means that certain protocol specific operations might
46not be available. This is not the case if you can tunnel through the proxy, as
47one with the --proxytunnel option.
48
49User and password that might be provided in the proxy string are URL decoded
50by curl. This allows you to pass in special characters such as @ by using %40
51or pass in a colon with %3a.
52
53The proxy host can be specified the same way as the proxy environment
54variables, including the protocol prefix (http://) and the embedded user +
55password.
56
57When a proxy is used, the active FTP mode as set with --ftp-port, cannot be
58used.
59
60Doing FTP over an HTTP proxy without --proxytunnel makes curl do HTTP with an
61FTP URL over the proxy. For such transfers, common FTP specific options do not
62work, including --ftp-ssl-reqd and --ftp-ssl-control.
63