glibmm
2.31.22
|
Proxy - Interface for proxy handling. More...
#include <giomm/proxy.h>
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< IOStream > | 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. | |
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< IOStream > | connect_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< Proxy > | get_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::Proxy > | wrap (GProxy* object, bool take_copy=false) |
A Glib::wrap() method for this object. |
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().
virtual Gio::Proxy::~Proxy | ( | ) | [virtual] |
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.
connection | A IOStream. |
proxy_address | A ProxyAddress. |
cancellable | A Cancellable. |
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 | ) |
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.
protocol | The proxy protocol name (e.g. http, socks, etc). |
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().
true
if hostname resolution is supported. Glib::RefPtr< Gio::Proxy > wrap | ( | GProxy * | object, |
bool | take_copy = false |
||
) | [related] |
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |