|
|
|
|
|
- FTPProxy and SOCKS5 protocol
FTPProxy (Function) In french: FTPProxy Specifies whether the communication functions that use the FTP protocol must go through a proxy to run their requests. This function is taken into account during the next call to a function that uses the FTP protocol. Caution: - This function applies to the FTP protocol only (and not to FTPIS/FTPES/SFTP).
- In Linux, Android and iOS, this function can only be used with the SOCKS5 protocol (ftpProxySOCKS5 constant).
FTPProxy(ftpProxyUserTogether, "test", 2121, "test", "test")
ConnectionID is int
ConnectionID = FTPConnect("mytest.doc.com", "test", "test", 21, True, 20)
IF ConnectionID = -1 THEN
Error(ErrorInfo(errFullDetails))
ELSE
...
END
Syntax
FTPProxy(<Proxy Type> [, <Proxy address> [, <Proxy port> [, <Username> [, <Password>]]]])
<Proxy Type>: Integer constant Type of the FTP proxy to use: | | ftpProxyNone | Allows to cancel the use of the FTP proxy. | ftpProxyOpen | FTP proxy requiring the "OPEN" command. The following statements will be sent: - USER with the Proxy login
- PASS with the Proxy password
- OPEN in the following format: @<Address of FTP Server>:<Port of FTP Server>
- USER with the FTP login
- PASS with the FTP password
| ftpProxySite | FTP proxy requiring the "SITE" command. The following statements will be sent: - USER with the Proxy login
- PASS with the Proxy password
- SITE in the following format: @<Address of FTP Server>:<Port of FTP Server>
- USER with the FTP login
- PASS with the FTP password
| ftpProxySOCKS5 | FTP proxy using the SOCKS5 protocol. | ftpProxyUserSeparate | FTP proxy requiring the "USER" command and the "PASS" command separately. The following statements will be sent: - USER with the Proxy login
- PASS with the Proxy password
- USER in the following format: <FTP Login>@<Address of FTP Server>:<Port of FTP Server>
- PASS with the FTP password
| ftpProxyUserTogether | FTP proxy requiring the "USER" command with the user and the password. The following statements will be sent: - USER in the following format: <Proxy Login>:<FTP Login>@<Address of FTP Server>:<Port of FTP Server>
- PASS in the following format: <Proxy Password>:<FTP Password>
|
<Proxy address>: Optional character string Address of the FTP proxy in the following format: - IP address in XXX.XXX.XXX.XXX format (e.g. 125.5.110.100).
- URL containing the server name (www.windev.com for example). This syntax is recommended.
- IP address returned by NetIPAddress.
<Proxy port>: Optional integer Port number of the FTP proxy. This parameter is set to 21 if it is not specified. <Username>: Optional character string Authentication through the FTP proxy. If this parameter is an empty string ("" by default), no authentication is performed. <Password>: Optional character string or secret string Password for authentication through the proxy. This parameter is ignored if <Username> is an empty string ("").
New in version 2025Secret strings: If you use the secret string vault, the type of secret string used for this parameter must be "Ansi or Unicode string". To learn more about secret strings and how to use the vault, see Secret string vault. Remarks FTPProxy and SOCKS5 protocol To use the SOCKS5 protocol with FTPProxy, use the ftpProxySOCKS5 constant to specify the type of proxy to be used. CAUTION: - A SOCKS5 proxy cannot be used if FTP is configured to use WinInet (mode that uses Internet Explorer). This mode can be configured with the httpConfigureMode constant of FTPConfigure. Calling FTPProxy will cause a fatal error.
- SOCKS5 proxies can only be used with FTP and SFTP. If a SOCKS5 proxy is configured, calling FTPConnect on a server via FTPES or FTPIS will cause a fatal error.
Example:
FTPConfigure(ftpConfigureMode, 1)
FTPProxy(ftpProxySOCKS5, "172.12.2.79",1080, "USER", "PWD")
nFTPID is int = FTPConnect("ftp://test.rebex.net/", "demo", "password", 21)
IF nFTPID = -1 THEN
Error(ErrorInfo(errFullDetails))
ELSE
Info("OK")
END
FTPDisconnect(nFTPID)
FTPProxy(ftpProxyNone)
Business / UI classification: Business Logic
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|