Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: ProxyResolver

[18:7] extends: object

GProxyResolver provides synchronous and asynchronous network proxy resolution. GProxyResolver is used within [class@Gio.SocketClient] through the method [method@Gio.SocketConnectable.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.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • ProxyResolver (Handle = null)

    Creates a new ProxyResolver by wrapping a native handle or another wrapper.

    • @p Handle is the native handle or another wrapper whose handle to adopt.
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • 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.)

  • lookup (string uri, object cancellable)

    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 <protocol> could be http, rtsp, socks or other proxying protocol. If you don't know what network protocol is being used on the socket, you should use none as the URI protocol. In this case, the resolver might still return a generic proxy type (such as SOCKS), but would not return protocol-specific proxy types (such as http). direct:// is used when no proxy is needed. Direct connection should not be attempted unless it is part of the returned array of proxies.

    • @p uri is a URI representing the destination to connect to.
    • @p cancellable is a #GCancellable, or %NULL.
  • lookup_finish (object result)

    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.

    • @p result is the result passed to your #GAsyncReadyCallback.