AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Comunicación / Funciones HTTP
  • Using a proxy
  • How to check whether the proxy exists?
  • Proxy and SOCKS5 protocol
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Specifies whether the communication functions that use HTTP or HTTPS must go through a proxy to execute their requests. A proxy is used to share the access to Internet between the different network computers.
The relevant communication functions are as follows:
This function is only taken into account the next time a function that uses HTTP is called.
Remarks:
  • Proxy configures the access to Internet via a proxy for the entire application.
  • FTPProxy allows you to configure the use of a proxy for the FTP functions.
  • SocketProxy determines if TCP sockets and WebSockets must go through a SOCKS5 proxy.
Ejemplo
// Indicates that the next connections will go via a proxy
Proxy("192.168.0.1", 8080)

// Performs an HTTP request
sHTMLCode is string = HTTPRequest("http://www.windev.com")
Info("The HTML code is: " + sCodeHTML)

// Cancels the use of proxy
Proxy("")
Sintaxis

Defining the proxy Ocultar los detalles

Proxy(<Proxy address> [, <Proxy port> [, <Username> [, <Password>]]])
<Proxy address>: Character string
Address of proxy in the following format:
  • IP address in XXX.XXX.XXX.XXX format (125.5.110.100 for example).
  • URL containing the server name (www.windev.com for example). This syntax is recommended.
  • IP address returned by NetIPAddress.
  • SOCKS5 proxy address, in the following format:
    socks5://<Proxy IP address>
<Proxy port>: Optional integer
Port number of proxy.
This parameter is set to 80 if it is not specified.
<Username>: Optional character string
Authentication for the proxy.
If this parameter is an empty string ("" by default), no authentication is performed.
<Password>: Optional string or Secret string
Password for authentication through the proxy.
This parameter is ignored if <Username> is an empty string ("").
Novedad versión 2025
Cadenas secretas: Si utiliza el almacén de cadenas secretas, el tipo de cadena secreta utilizado para este parámetro debe ser "ANSI o Unicode string".
Para obtener más información sobre las cadenas secretas y el almacén, consulte Almacén de cadenas secretas.

Removing a proxy

Proxy("")
Observaciones
WINDEVJavaCódigo de Usuario (UMC)

Using a proxy

With Proxy, the end user will be able to configure the WINDEV or WINDEV Mobile application to use or not a proxy for the HTTP protocol. We advise you to implement a setting window in the WINDEV application to enter the address of the proxy if necessary.
Some proxies require a specific setting in Internet Explorer. In this case, using the function Proxy is not required: function HTTPConfigure (constant httpParameterMode) will allow Internet Explorer to be used globally for sending HTTP requests.

How to check whether the proxy exists?

The following code is used to check whether the proxy exists via SocketConnect:
IF SocketConnect(lsSocketName, llSocketPort, lsSocketAddr) = False THEN
	RETURN False
ELSE
	SocketClose(lsSocketName)
END

Proxy and SOCKS5 protocol

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:
// Do not use WinInet to access the SOCKS5 proxy
HTTPConfigure(httpConfigureMode, 1)
// The following functions will use the SOCKS5 proxy 
// at address 172.12.2.79:1080 with the identifiers USER:PWD 
Proxy("socks5://172.12.2.79", 1080, "USER", "PWD")
req is httpRequest
req.URL = "https://www.google.com"
req is httpResponse = req.Send()
IF ErrorOccurred THEN
	Error(ErrorInfo(errFullDetails))
ELSE
	Info("OK")
END
Proxy("")
Clasificación Lógica de negocio / UI: Lógica de negocio
Componente: wd300com.dll
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 16/05/2025

Señalar un error o enviar una sugerencia | Ayuda local