Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: Proxy

[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].

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • Proxy (Handle = null)

    Creates a new Proxy 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.
  • 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.

    • @p connection is a #GIOStream.
    • @p proxy_address is a #GProxyAddress.
    • @p cancellable is a #GCancellable.
  • connect_finish (object result)

    See g_proxy_connect().

    • @p 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().