CURL.SetOptionProxy
-------------------

Set HTTP proxy to use.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [CURL](component_CURL.md) | [2.5](newinversion25.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

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

**MBS**( **"CURL.SetOptionProxy";** /\* Set HTTP proxy to use. \*/  
**$curl**; /\* The CURL session handle. \*/   
**$Value**; /\* The proxy stringe.g. "http://cache.local.com/:8000" \*/   
**$Encoding**) /\* Optional; The text encoding for text parameter.   
Default is UTF-8.e.g. "utf8" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| curl | The CURL session handle. | $curl |  |
| Value | The proxy string | "http://cache.local.com/:8000" |  |
| Encoding | The text encoding for text parameter.    Default is UTF-8.   Possible encoding names: ANSI, ISO-8859-1, Latin1, Mac, Native, UTF-8, DOS, Hex, Base64 or Windows. More listed in the [FAQ](https://www.monkeybreadsoftware.com/filemaker/faq.shtml). | "utf8" | Optional |

### 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](CURLSetOptionProxyPort.md).  
  
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](CURLSetOptionQuote.md) and similar FTP specifics that don't work unless you tunnel through the HTTP proxy. Such tunneling is activated with [CURL.SetOptionHTTPProxyTunnel](CURLSetOptionHTTPProxyTunnel.md).  
  
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.  
See also [PROXY](https://curl.haxx.se/libcurl/c/CURLOPT_PROXY.html) option in CURL manual.

### Examples

Set a proxy:

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

- [CURL.SetOptionNoProxy](CURLSetOptionNoProxy.md)
- [CURL.SetOptionPort](CURLSetOptionPort.md)
- [CURL.SetOptionPreProxy](CURLSetOptionPreProxy.md)
- [CURL.SetOptionProxySSLKey](CURLSetOptionProxySSLKey.md)
- [CURL.SetOptionProxyType](CURLSetOptionProxyType.md)
- [CURL.SetOptionProxyUsername](CURLSetOptionProxyUsername.md)
- [CURL.SetOptionQuote](CURLSetOptionQuote.md)
- [CURL.SetOptionRange](CURLSetOptionRange.md)
- [CURL.SetOptionUpload](CURLSetOptionUpload.md)
- [CURL.SetOptionURL](CURLSetOptionURL.md)

### Release notes

- **Version 11.3**
    - Added [CURL.SetOptionCAInfoBlob](https://www.mbsplugins.eu/CURLSetOptionCAInfoBlob.shtml) and [CURL.SetOptionProxyCAInfoBlob](https://www.mbsplugins.eu/CURLSetOptionProxyCAInfoBlob.shtml) functions.
- **Version 10.4**
    - Changed [CURL.SetOptionIssuerCertBlob](https://www.mbsplugins.eu/CURLSetOptionIssuerCertBlob.shtml), [CURL.SetOptionProxyIssuerCert](https://www.mbsplugins.eu/CURLSetOptionProxyIssuerCert.shtml), [CURL.SetOptionProxyIssuerCertBlob](https://www.mbsplugins.eu/CURLSetOptionProxyIssuerCertBlob.shtml), [CURL.SetOptionProxySSLCertBlob](https://www.mbsplugins.eu/CURLSetOptionProxySSLCertBlob.shtml), [CURL.SetOptionProxySSLKeyBlob](https://www.mbsplugins.eu/CURLSetOptionProxySSLKeyBlob.shtml), [CURL.SetOptionSSLCertBlob](https://www.mbsplugins.eu/CURLSetOptionSSLCertBlob.shtml) and [CURL.SetOptionSSLKeyBlob](https://www.mbsplugins.eu/CURLSetOptionSSLKeyBlob.shtml) to replace line endings for keys to LF if needed.
- **Version 10.3**
    - Added [CURL.SetOptionIssuerCertBlob](https://www.mbsplugins.eu/CURLSetOptionIssuerCertBlob.shtml), [CURL.SetOptionProxyIssuerCert](https://www.mbsplugins.eu/CURLSetOptionProxyIssuerCert.shtml), [CURL.SetOptionProxyIssuerCertBlob](https://www.mbsplugins.eu/CURLSetOptionProxyIssuerCertBlob.shtml), [CURL.SetOptionProxySSLCertBlob](https://www.mbsplugins.eu/CURLSetOptionProxySSLCertBlob.shtml), [CURL.SetOptionProxySSLKeyBlob](https://www.mbsplugins.eu/CURLSetOptionProxySSLKeyBlob.shtml), [CURL.SetOptionSSLCertBlob](https://www.mbsplugins.eu/CURLSetOptionSSLCertBlob.shtml) and [CURL.SetOptionSSLKeyBlob](https://www.mbsplugins.eu/CURLSetOptionSSLKeyBlob.shtml) functions.
- **Version 8.3**
    - Added [CURL.SetOptionDisallowUserNameInURL](http://www.mbsplugins.eu/CURLSetOptionDisallowUserNameInURL.shtml), [CURL.SetOptionProxyTLS13Ciphers](http://www.mbsplugins.eu/CURLSetOptionProxyTLS13Ciphers.shtml) and [CURL.SetOptionTLS13Ciphers](http://www.mbsplugins.eu/CURLSetOptionTLS13Ciphers.shtml).

### Blog Entries

- [Translating Insert from URL options for CURL to MBS Plugin calls](https://www.mbsplugins.de/archive/2020-12-14/Translating_Insert_from_URL_op/monkeybreadsoftware_blog_filemaker)
- [Comparing Base Elements Plugin to MBS FileMaker Plugin](https://www.mbsplugins.de/archive/2017-10-24/Comparing_Base_Elements_Plugin/monkeybreadsoftware_blog_filemaker)

Created 18th August 2014 , last changed 5th December 2016

  
[CURL.SetOptionProtocolsString](CURLSetOptionProtocolsString.md) - [CURL.SetOptionProxyAuth](CURLSetOptionProxyAuth.md)

[HTML Version](CURLSetOptionProxy.shtml)