xref: /curl/docs/cmdline-opts/socks4.md (revision 6e494a23)
1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Long: socks4
5Arg: <host[:port]>
6Help: SOCKS4 proxy on given host + port
7Added: 7.15.2
8Category: proxy
9Multi: single
10See-also:
11  - socks4a
12  - socks5
13  - socks5-hostname
14Example:
15  - --socks4 hostname:4096 $URL
16---
17
18# `--socks4`
19
20Use the specified SOCKS4 proxy. If the port number is not specified, it is
21assumed at port 1080. Using this socket type make curl resolve the hostname
22and passing the address on to the proxy.
23
24To specify proxy on a unix domain socket, use localhost for host, e.g.
25`socks4://localhost/path/to/socket.sock`
26
27This option overrides any previous use of --proxy, as they are mutually
28exclusive.
29
30This option is superfluous since you can specify a socks4 proxy with --proxy
31using a socks4:// protocol prefix. (Added in 7.21.7)
32
33--preproxy can be used to specify a SOCKS proxy at the same time proxy is used
34with an HTTP/HTTPS proxy (added in 7.52.0). In such a case, curl first
35connects to the SOCKS proxy and then connects (through SOCKS) to the HTTP or
36HTTPS proxy.
37