|
|
|
|
|
- Overview
- How to use the SOCKS5 protocol with WINDEV, WEBDEV and WINDEV Mobile?
- Proxy function
- FTPProxy
- SocketProxy
SOCKS5 is a simple network protocol intended to standardize the use of proxies for applications. After a short transaction phase between the application and the SOCKS5 proxy server, the application can seamlessly exchange data over the socket. How to use the SOCKS5 protocol with WINDEV, WEBDEV and WINDEV Mobile? There are several functions that allow you to configure the use of a proxy via the SOCKS5 protocol: Proxy function To use the SOCKS5 protocol with Proxy, simply prefix the name of the proxy server with "socks5://" and use the function with the standard syntax (passing the port and the identifiers). CAUTION: - A SOCKS5 proxy cannot be used if HTTP is configured to use WinInet (mode that uses Internet Explorer). This mode can be configured with the httpConfigureMode constant of HTTPConfigure.
- Calling HTTPRequest and HTTPSendForm with a proxy that uses SOCKS5 will force the use of the cURL command.
Therefore, it is recommended to use a variable of type httpRequest with a SOCKS5 proxy.
Example:
HTTPConfigure(httpConfigureMode, 1)
Proxy("socks5://172.12.2.79", 1080, "USER", "PWD")
req is httpRequest
req.URL = "https://www.google.fr"
rep is httpResponse = req.Send()
IF ErrorOccurred THEN
Error(ErrorInfo(errFullDetails))
ELSE
Info("OK")
END
Proxy("")
FTPProxy 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")
nIDFTP is int = FTPConnect("ftp://test.rebex.net/", "demo", "password", 21)
IF nIDFTP = -1 THEN
Error(ErrorInfo(errFullDetails))
ELSE
Info("OK")
END
FTPDisconnect(nIDFTP)
FTPProxy(ftpProxyNone)
SocketProxy SocketProxy allows you to specify whether TCP sockets and WebSockets must go through a SOCKS5 proxy to execute their requests.
SocketProxy("socks5://172.17.2.79",1080,"USER","PWD")
IF NOT SocketConnect("tcp_via_socks5", 4242, "172.19.5.80") THEN
Error(ErrorInfo(errFullDetails))
ELSE
Info("OK")
SocketWrite("tcp_via_socks5", "écho")
s is Buffer = SocketRead("tcp_via_socks5")
Trace(BufferToHexa(s))
SocketClose("tcp_via_socks5")
END
SocketProxy("")
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|