Previous | Next

SetProxy Method

Sets the proxy server information for the specified network protocol.

Boolean SetProxy(
     Integer protocolId,
     String proxyServer,
     String proxyUserName,
     String proxyPassword,
     Integer method
)

Parameters

protocolId
Type: Integer
The network protocol ID for which the proxy server information is to be set. Valid network protocol IDs are:

  • 0 - HTTP protocol
  • 1 - HTTPS protocol (secure HTTP, HTTP over SSL)
  • 2 - FTP protocol
  • 3 - Secure FTP, FTP over SSL

proxyServer
Type: String
The proxy host and port (if it's different than the default port), like "proxyHost.com" or "proxyHost.com:52300" or "128.55.74.230:52300". If you don't wish to use the proxy server for the specified protocolId, set the proxyServer to "" (empty string).

proxyUserName
Type: String
The user name of the login credentials in case authentication is required on the proxy server, otherwise set it to "" (empty string).

proxyPassword
Type: String
The password of the login credentials in case authentication is required on the proxy server, otherwise set it to "" (empty string).

method
Type: Integer
The proxy scheme used by the proxy server. If the protocolId parameter specifies the HTTP or HTTPS protocol, the following method values are supported:

  • 0 - Standard
  • 1 - HTTP CONNECT (tunneling)
If the protocolId parameter specifies the FTP or secure FTP (FTP over SSL) protocol, the following method values are supported:
  • 0 - SITE host

    USER proxyUserName
    PASS proxyPassword
    SITE host
    USER userName
    PASS password
     
  • 1 - USER userName@host

    USER userName@host
    PASS password
     
  • 2 - USER with login

    USER proxyUserName
    PASS proxyPassword
    USER userName@host
    PASS password
     
  • 3 - USER/PASS/ACCT

    USER userName@host proxyUserName
    PASS password
    ACCT proxyPassword
     
  • 4 - OPEN host

    USER proxyUserName
    PASS proxyPassword
    OPEN host
    USER userName
    PASS password
     
  • 5 - USER proxyUserName@host

    USER proxyUserName@host
    USER userName
    PASS password
     
  • 6 - USER/USER

    USER proxyUserName
    USER proxyPassword
    SITE host
    USER userName
    PASS password
     
  • 7 - USER userName@proxyUserName@host

    USER userName@proxyUserName@host
    PASS password@proxyPassword

Return Value

Type: Boolean

If the method succeeds, the return value is true. If the method fails, the return value is false. To get extended error information, call GetLastError and GetLastErrorDesc methods.

Remarks

The default proxy settings are taken from the proxy settings in Microsoft Internet Explorer.