ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Communication / Sockets
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
SocketProxy (Function)
In french: SocketProxy
Specifies whether TCP sockets and WebSockets must go through a SOCKS5 proxy to execute requests.
AndroidAndroid Widget This function is only available for WebSockets.
Example
// SOCKS5 proxy info
SocketProxy("socks5://172.17.2.79",1080,"USER","PWD")
 
// Connect to the server through the proxy
IF NOT SocketConnect("tcp_through_socks5", 4242, "172.19.5.80") THEN
Error(ErrorInfo(errFullDetails))
ELSE
// Write and read operations (as usual)
Info("OK")
SocketWrite("tcp_through_socks5", "echo")
s is Buffer = SocketRead("tcp_through_socks5")
Trace(BufferToHexa(s))
SocketClose("tcp_through_socks5")
END
 
// Remove proxy
SocketProxy("")
Syntax

Defining the proxy Hide the details

SocketProxy(<Proxy address> [, <ProxyPort> [, <Username> [, <Password>]]])
<Proxy address>: Character string
SOCKS5 proxy address, in the following format:
socks5://<Proxy IP address>
<ProxyPort>: Optional integer
SOCKS5 proxy port number. This parameter is set to 1080 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
Password for authentication through the proxy. This parameter is ignored if <Username> is an empty string ("").

Removing a proxy

SocketProxy("")
Component: wd290com.dll
Minimum version required
  • Version 28
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/21/2023

Send a report | Local help