Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.1   6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4    Statistic  

CURL.SetOptionProxy

Set HTTP proxy to use.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
CURL 2.5 Yes Yes Yes Yes Yes

MBS( "CURL.SetOptionProxy"; Handle; Value { ; Encoding } )

Parameters

Parameter Description Example value
Handle The CURL session handle. $curl
Value The proxy string "http://cache.local.com/:8000"
Encoding Optional
The text encoding for text parameter.
Default is UTF-8.
Possible encoding names: ANSI, Arabic-Mac, Arabic-Win, Baltic-Win, CentralEurope-Mac, ChineseSimp-Mac, ChineseSimp-Win, ChineseTrad-Mac, ChineseTrad-Win, Cyrillic-Mac, Cyrillic-Win, EasternEurope-Win, Greek-Mac, Greek-Win, Hebrew-Mac, Hebrew-Win, ISO-8859-1, ISO-8859-2, ISO-8859-3, ISO-8859-4, ISO-8859-5, ISO-8859-6, ISO-8859-7, ISO-8859-8, ISO-8859-9, ISO-8859-15, Korean-Johab, Korean-Mac, Korean-Win, Latin1, Mac, Native, ShiftJIS-Mac, ShiftJIS-Win, Turkish-Mac, Turkish-Win, UTF-8, DOS or Windows. Pass native to use the native encoding of the current platform.
"utf8"

Result

Returns "OK" on success.

Description

Set HTTP proxy to use.
The parameter should be a text string holding the host name or dotted IP address. To specify port number in this string, append :[port] to the end of the host name. The proxy string may be prefixed with [protocol]:// since any such prefix will be ignored. The proxy's port number may optionally be specified with the separate option. If not specified, libcurl will default to using port 1080 for proxies. see also CURL.SetOptionProxyPort.

When you tell the library to use an HTTP proxy, libcurl will transparently convert operations to HTTP even if you specify an FTP URL etc. This may have an impact on what other features of the library you can use, such as CURL.SetOptionQuote and similar FTP specifics that don't work unless you tunnel through the HTTP proxy. Such tunneling is activated with CURL.SetOptionHTTPProxyTunnel.

libcurl respects the environment variables http_proxy, ftp_proxy, all_proxy etc, if any of those are set. The CURL.SetOptionProxy option does however override any possibly set environment variables.

Setting the proxy string to "" (an empty string) will explicitly disable the use of a proxy, even if there is an environment variable set for it.

Since 7.14.1, the proxy host string given in environment variables can be specified the exact same way as the proxy can be set with CURL.SetOptionProxy, include protocol prefix (http://) and embedded user + password.

Since 7.21.7, the proxy string may be specified with a protocol:// prefix to specify alternative proxy protocols. Use socks4://, socks4a://, socks5:// or socks5h:// (the last one to enable socks5 and asking the proxy to do the resolving, also known as CURLPROXY_SOCKS5_HOSTNAME type) to request the specific SOCKS version to be used. No protocol specified, http:// and all others will be treated as HTTP proxies.

Setting the property and getting back OK does just mean that the plugin passed the value. It does not confirm that the proxy is working or used.

Examples

Set a proxy:

MBS( "CURL.SetOptionProxy"; $curl; "http://cache.local.com/:8000“)

See also


CURL.SetOptionProtocols   -   CURL.SetOptionProxyAuth

Feedback: Report problem or ask question.




Links
MBS Xojo Plugins