EDataServer.Source.proxy_lookup_sync

### Method

# EDataServer Sourceproxy_lookup_sync

since: 3.12

#### Declaration [src]

    gchar**
    e_source_proxy_lookup_sync (
      ESource* source,
      const gchar* uri,
      GCancellable* cancellable,
      GError** error
    )

#### Description [src]

Looks into `source`‘s `ESourceProxy` extension to determine what proxy, if any, to use to connect to `uri`. The returned proxy URIs are of the same form described by g_proxy_resolver_lookup().

The proxy extension’s `ESourceProxy:method` controls how proxy URIs are determined:

When using `E_PROXY_METHOD_DEFAULT`, the function will defer to the `GProxyResolver` returned by g_proxy_resolver_get_default().

When using `E_PROXY_METHOD_MANUAL`, the function will configure a `GSimpleProxyResolver` from the HTTP, HTTPS, FTP and SOCKS properties, as well as `ESourceProxy:ignore-hosts`.

When using `E_PROXY_METHOD_AUTO`, the function will execute a proxy auto-config (PAC) file at `ESourceProxy:autoconfig-url`.

When using `E_PROXY_METHOD_NONE`, the function will only return direct://.

If `source` does not have an `ESourceProxy` extension, the function sets `error` to `G_IO_ERROR_NOT_SUPPORTED` and returns `NULL`.

Free the returned proxy URIs with `g_strfreev()` when finished with them.

Available since: 3.12

#### Parameters

`uri`

  Type: `const gchar*`

  A URI representing the destination to connect to.

  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

`cancellable`

  Type: `GCancellable`

  Optional `GCancellable` object, or `NULL`.

  The argument can be `NULL`.
  The data is owned by the caller of the method.

`error`

  Type: `GError **`

  The return location for a recoverable error.

  The argument can be `NULL`.
  If the return location is not `NULL`, then you must initialize it to a `NULL` `GError*`.
  The argument will be left initialized to `NULL` by the method if there are no errors.
  In case of error, the argument will be set to a newly allocated `GError`; the caller will take ownership of the data, and be responsible for freeing it.

#### Return value

Type: An array of `utf8`

A `NULL`-terminated array of proxy URIs, or `NULL`.

The array is `NULL`-terminated.
The caller of the method takes ownership of the returned data, and is responsible for freeing it.
The return value can be `NULL`.
Each element is a NUL terminated UTF-8 string.