Basics
Guides
API Reference
Basics
Guides
API Reference
[16:7] extends: object
A GProxy handles connecting to a remote host via a given type of proxy
server. It is implemented by the gio-proxy extension point. The extensions
are named after their proxy protocol name. As an example, a SOCKS5 proxy
implementation can be retrieved with the name socks5 using the function
[method@Gio.IOExtensionPoint.get_extension_by_name].
Proxy (Handle = null)
Creates a new
Proxyby 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.connect (object connection, object proxy_address, object cancellable)
Given @connection to communicate with a proxy (eg, a #GSocketConnection that is connected to the proxy server), this does the necessary handshake to connect to @proxy_address, and if required, wraps the #GIOStream to handle proxy payload.
connection is a #GIOStream.proxy_address is a #GProxyAddress.cancellable is a #GCancellable.connect_finish (object result)
See g_proxy_connect().
result is a #GAsyncResult.supports_hostname ()
Some proxy protocols expect to be passed a hostname, which they will resolve to an IP address themselves. Others, like SOCKS4, do not allow this. This function will return %FALSE if @proxy is implementing such a protocol. When %FALSE is returned, the caller should resolve the destination hostname first, and then pass a #GProxyAddress containing the stringified IP address to g_proxy_connect() or g_proxy_connect_async().

Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.