### Interface

# Gio ProxyResolver

since: 2.26

#### Description

    interface Gio.ProxyResolver : GObject.Object

`GProxyResolver` provides synchronous and asynchronous network proxy resolution. `GProxyResolver` is used within `GSocketClient` through the method `g_socket_connectable_proxy_enumerate()`.

Implementations of `GProxyResolver` based on libproxy and GNOME settings can be found in glib-networking. GIO comes with an implementation for use inside Flatpak portals.

Available since: 2.26

#### Prerequisite

In order to implement ProxyResolver, your type must inherit from`GObject`.

#### Implementations

- GSimpleProxyResolver

#### Functions

###### g_proxy_resolver_get_default

Gets the default `GProxyResolver` for the system.

since: 2.26

#### Instance methods

###### g_proxy_resolver_is_supported

Checks if `resolver` can be used on this system. (This is used internally; `g_proxy_resolver_get_default()` will only return a proxy resolver that returns `TRUE` for this method.).

since: 2.26

###### g_proxy_resolver_lookup

Looks into the system proxy configuration to determine what proxy, if any, to use to connect to `uri`. The returned proxy URIs are of the form `<protocol>://[user[:password]@]host[:port]` or `direct://`, where could be http, rtsp, socks or other proxying protocol.

since: 2.26

###### g_proxy_resolver_lookup_async

Asynchronous lookup of proxy. See `g_proxy_resolver_lookup()` for more details.

since: 2.26

###### g_proxy_resolver_lookup_finish

Call this function to obtain the array of proxy URIs when `g_proxy_resolver_lookup_async()` is complete. See `g_proxy_resolver_lookup()` for more details.

since: 2.26

#### Interface structure

    struct GioProxyResolverInterface {
      GTypeInterface g_iface;
      gboolean (* is_supported) (
        GProxyResolver* resolver
      );
      gchar** (* lookup) (
        GProxyResolver* resolver,
        const gchar* uri,
        GCancellable* cancellable,
        GError** error
      );
      void (* lookup_async) (
        GProxyResolver* resolver,
        const gchar* uri,
        GCancellable* cancellable,
        GAsyncReadyCallback callback,
        gpointer user_data
      );
      gchar** (* lookup_finish) (
        GProxyResolver* resolver,
        GAsyncResult* result,
        GError** error
      );

    }

The virtual function table for `GProxyResolver`.

###### Interface members

`g_iface` |
    GTypeInterface
| The parent interface.
`is_supported` |
    gboolean (* is_supported) (
        GProxyResolver* resolver
      )
| The virtual function pointer for g_proxy_resolver_is_supported().
`lookup` |
    gchar** (* lookup) (
        GProxyResolver* resolver,
        const gchar* uri,
        GCancellable* cancellable,
        GError** error
      )
| The virtual function pointer for g_proxy_resolver_lookup().
`lookup_async` |
    void (* lookup_async) (
        GProxyResolver* resolver,
        const gchar* uri,
        GCancellable* cancellable,
        GAsyncReadyCallback callback,
        gpointer user_data
      )
| The virtual function pointer for g_proxy_resolver_lookup_async().
`lookup_finish` |
    gchar** (* lookup_finish) (
        GProxyResolver* resolver,
        GAsyncResult* result,
        GError** error
      )
| The virtual function pointer for g_proxy_resolver_lookup_finish().

#### Virtual methods

###### Gio.ProxyResolver.is_supported

Checks if `resolver` can be used on this system. (This is used internally; `g_proxy_resolver_get_default()` will only return a proxy resolver that returns `TRUE` for this method.).

since: 2.26

###### Gio.ProxyResolver.lookup

Looks into the system proxy configuration to determine what proxy, if any, to use to connect to `uri`. The returned proxy URIs are of the form `<protocol>://[user[:password]@]host[:port]` or `direct://`, where could be http, rtsp, socks or other proxying protocol.

since: 2.26

###### Gio.ProxyResolver.lookup_async

Asynchronous lookup of proxy. See `g_proxy_resolver_lookup()` for more details.

since: 2.26

###### Gio.ProxyResolver.lookup_finish

Call this function to obtain the array of proxy URIs when `g_proxy_resolver_lookup_async()` is complete. See `g_proxy_resolver_lookup()` for more details.

since: 2.26