xf.li | bfc6e71 | 2025-02-07 01:54:34 -0800 | [diff] [blame^] | 1 | c: Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al. |
| 2 | SPDX-License-Identifier: curl |
| 3 | Long: ftp-port |
| 4 | Arg: <address> |
| 5 | Help: Use PORT instead of PASV |
| 6 | Short: P |
| 7 | Protocols: FTP |
| 8 | See-also: ftp-pasv disable-eprt |
| 9 | Category: ftp |
| 10 | Example: -P - ftp:/example.com |
| 11 | Example: -P eth0 ftp:/example.com |
| 12 | Example: -P 192.168.0.2 ftp:/example.com |
| 13 | Added: 4.0 |
| 14 | Multi: single |
| 15 | --- |
| 16 | Reverses the default initiator/listener roles when connecting with FTP. This |
| 17 | option makes curl use active mode. curl then tells the server to connect back |
| 18 | to the client's specified address and port, while passive mode asks the server |
| 19 | to setup an IP address and port for it to connect to. <address> should be one |
| 20 | of: |
| 21 | .RS |
| 22 | .IP interface |
| 23 | e.g. "eth0" to specify which interface's IP address you want to use (Unix only) |
| 24 | .IP "IP address" |
| 25 | e.g. "192.168.10.1" to specify the exact IP address |
| 26 | .IP "host name" |
| 27 | e.g. "my.host.domain" to specify the machine |
| 28 | .IP "-" |
| 29 | make curl pick the same IP address that is already used for the control |
| 30 | connection |
| 31 | .RE |
| 32 | |
| 33 | Disable the use of PORT with --ftp-pasv. Disable the attempt to use the EPRT |
| 34 | command instead of PORT by using --disable-eprt. EPRT is really PORT++. |
| 35 | |
| 36 | You can also append ":[start]-[end]\&" to the right of the address, to tell |
| 37 | curl what TCP port range to use. That means you specify a port range, from a |
| 38 | lower to a higher number. A single number works as well, but do note that it |
| 39 | increases the risk of failure since the port may not be available. |
| 40 | (Added in 7.19.5) |