Basics
Guides
API Reference
Basics
Guides
API Reference
[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.
ProxyResolver (Handle = null)
Creates a new
ProxyResolverby wrapping a native handle or another wrapper.
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 exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
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]ordirect://, 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 usenoneas 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.
uri is a URI representing the destination to connect to.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.
result is the result passed to your #GAsyncReadyCallback.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.