glibmm 2.28.2
Public Member Functions | Static Public Member Functions | Related Functions
Gio::Proxy Class Reference

Proxy - Interface for proxy handling. More...

#include <giomm/proxy.h>

Inheritance diagram for Gio::Proxy:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual ~Proxy ()
GProxy* gobj ()
 Provides access to the underlying C GObject.
const GProxy* gobj () const
 Provides access to the underlying C GObject.
Glib::RefPtr< IOStreamconnect (const Glib::RefPtr< IOStream >& connection, const Glib::RefPtr< const ProxyAddress >& proxy_adress, const Glib::RefPtr< Cancellable >& cancellable)
 Given connection to communicate with a proxy (eg, a SocketConnection that is connected to the proxy server), this does the necessary handshake to connect to proxy_address, and if required, wraps the IOStream to handle proxy payload.
void connect_async (const Glib::RefPtr< IOStream >& connection, const Glib::RefPtr< const ProxyAddress >& proxy_address, const SlotAsyncReady& slot, const Glib::RefPtr< Cancellable >& cancellable)
 An Asynchronous version of connect().
void connect_async (const Glib::RefPtr< IOStream >& connection, const Glib::RefPtr< const ProxyAddress >& proxy_address, const SlotAsyncReady& slot)
 An Asynchronous version of connect().
Glib::RefPtr< IOStreamconnect_finish (const Glib::RefPtr< AsyncResult >& result)
 See g_proxy_connect().
bool supports_hostname () const
 Some proxy protocols expect to be passed a hostname, which they will resolve to an IP address themselves.

Static Public Member Functions

static void add_interface (GType gtype_implementer)
static Glib::RefPtr< Proxyget_default_for_protocol (const Glib::ustring& protocol)
 Lookup "gio-proxy" extension point for a proxy implementation that supports specified protocol.

Related Functions

(Note that these are not member functions.)

Glib::RefPtr< Gio::Proxywrap (GProxy* object, bool take_copy=false)
 A Glib::wrap() method for this object.

Detailed Description

Proxy - Interface for proxy handling.

A Proxy 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 C API's function g_io_extension_point_get_extension_by_name().

Since glibmm 2.28:

Constructor & Destructor Documentation

virtual Gio::Proxy::~Proxy ( ) [virtual]

Member Function Documentation

static void Gio::Proxy::add_interface ( GType  gtype_implementer) [static]
Glib::RefPtr<IOStream> Gio::Proxy::connect ( const Glib::RefPtr< IOStream >&  connection,
const Glib::RefPtr< const ProxyAddress >&  proxy_adress,
const Glib::RefPtr< Cancellable >&  cancellable 
)

Given connection to communicate with a proxy (eg, a SocketConnection that is connected to the proxy server), this does the necessary handshake to connect to proxy_address, and if required, wraps the IOStream to handle proxy payload.

Since glibmm 2.26:
Parameters:
connectionA IOStream.
proxy_addressA ProxyAddress.
cancellableA Cancellable.
Returns:
A IOStream that will replace connection. This might be the same as connection, in which case a reference will be added.
void Gio::Proxy::connect_async ( const Glib::RefPtr< IOStream >&  connection,
const Glib::RefPtr< const ProxyAddress >&  proxy_address,
const SlotAsyncReady slot,
const Glib::RefPtr< Cancellable >&  cancellable 
)

An Asynchronous version of connect().

void Gio::Proxy::connect_async ( const Glib::RefPtr< IOStream >&  connection,
const Glib::RefPtr< const ProxyAddress >&  proxy_address,
const SlotAsyncReady slot 
)

An Asynchronous version of connect().

Glib::RefPtr<IOStream> Gio::Proxy::connect_finish ( const Glib::RefPtr< AsyncResult >&  result)

See g_proxy_connect().

Since glibmm 2.26:
Parameters:
resultA AsyncRetult.
Returns:
A IOStream.
static Glib::RefPtr<Proxy> Gio::Proxy::get_default_for_protocol ( const Glib::ustring protocol) [static]

Lookup "gio-proxy" extension point for a proxy implementation that supports specified protocol.

Since glibmm 2.26:
Parameters:
protocolThe proxy protocol name (e.g. http, socks, etc).
Returns:
Return a Proxy or 0 if protocol is not supported.
GProxy* Gio::Proxy::gobj ( ) [inline]

Provides access to the underlying C GObject.

Reimplemented from Glib::Interface.

const GProxy* Gio::Proxy::gobj ( ) const [inline]

Provides access to the underlying C GObject.

Reimplemented from Glib::Interface.

bool Gio::Proxy::supports_hostname ( ) const

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 ProxyAddress containing the stringified IP address to g_proxy_connect() or g_proxy_connect_async().

Since glibmm 2.26:
Returns:
true if hostname resolution is supported.

Friends And Related Function Documentation

Glib::RefPtr< Gio::Proxy > wrap ( GProxy *  object,
bool  take_copy = false 
) [related]

A Glib::wrap() method for this object.

Parameters:
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns:
A C++ instance that wraps this C instance.