Gio.Proxy¶
| Implementations: | |
|---|---|
| None | |
Methods¶
| class | get_default_for_protocol (protocol) |
connect (connection, proxy_address, cancellable) |
|
connect_async (connection, proxy_address, cancellable, callback, *user_data) |
|
connect_finish (result) |
|
supports_hostname () |
Virtual Methods¶
do_connect (connection, proxy_address, cancellable) |
|
do_connect_async (connection, proxy_address, cancellable, callback, *user_data) |
|
do_connect_finish (result) |
|
do_supports_hostname () |
Properties¶
None
Signals¶
None
Fields¶
None
Class Details¶
-
class
Gio.Proxy¶ Bases: GObject.GInterfaceStructure: Gio.ProxyInterfaceA
Gio.Proxyhandles 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 functionGio.IOExtensionPoint.get_extension_by_name().New in version 2.26.
-
classmethod
get_default_for_protocol(protocol)[source]¶ Parameters: protocol ( str) – the proxy protocol name (e.g. http, socks, etc)Returns: return a Gio.ProxyorNoneif protocol is not supported.Return type: Gio.ProxyFind the
gio-proxyextension point for a proxy implementation that supports the specified protocol.New in version 2.26.
-
connect(connection, proxy_address, cancellable)[source]¶ Parameters: - connection (
Gio.IOStream) – aGio.IOStream - proxy_address (
Gio.ProxyAddress) – aGio.ProxyAddress - cancellable (
Gio.CancellableorNone) – aGio.Cancellable
Raises: Returns: a
Gio.IOStreamthat will replace connection. This might be the same as connection, in which case a reference will be added.Return type: Given connection to communicate with a proxy (eg, a
Gio.SocketConnectionthat is connected to the proxy server), this does the necessary handshake to connect to proxy_address, and if required, wraps theGio.IOStreamto handle proxy payload.New in version 2.26.
- connection (
-
connect_async(connection, proxy_address, cancellable, callback, *user_data)[source]¶ Parameters: - connection (
Gio.IOStream) – aGio.IOStream - proxy_address (
Gio.ProxyAddress) – aGio.ProxyAddress - cancellable (
Gio.CancellableorNone) – aGio.Cancellable - callback (
Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallback - user_data (
objectorNone) – callback data
Asynchronous version of
Gio.Proxy.connect().New in version 2.26.
- connection (
-
connect_finish(result)[source]¶ Parameters: result ( Gio.AsyncResult) – aGio.AsyncResultRaises: GLib.ErrorReturns: a Gio.IOStream.Return type: Gio.IOStreamSee
Gio.Proxy.connect().New in version 2.26.
-
supports_hostname()[source]¶ Returns: Trueif hostname resolution is supported.Return type: boolSome 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
Falseif self is implementing such a protocol. WhenFalseis returned, the caller should resolve the destination hostname first, and then pass aGio.ProxyAddresscontaining the stringified IP address toGio.Proxy.connect() orGio.Proxy.connect_async().New in version 2.26.
-
do_connect(connection, proxy_address, cancellable) virtual¶ Parameters: - connection (
Gio.IOStream) – aGio.IOStream - proxy_address (
Gio.ProxyAddress) – aGio.ProxyAddress - cancellable (
Gio.CancellableorNone) – aGio.Cancellable
Returns: a
Gio.IOStreamthat will replace connection. This might be the same as connection, in which case a reference will be added.Return type: Given connection to communicate with a proxy (eg, a
Gio.SocketConnectionthat is connected to the proxy server), this does the necessary handshake to connect to proxy_address, and if required, wraps theGio.IOStreamto handle proxy payload.New in version 2.26.
- connection (
-
do_connect_async(connection, proxy_address, cancellable, callback, *user_data) virtual¶ Parameters: - connection (
Gio.IOStream) – aGio.IOStream - proxy_address (
Gio.ProxyAddress) – aGio.ProxyAddress - cancellable (
Gio.CancellableorNone) – aGio.Cancellable - callback (
Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallback - user_data (
objectorNone) – callback data
Asynchronous version of
Gio.Proxy.connect().New in version 2.26.
- connection (
-
do_connect_finish(result) virtual¶ Parameters: result ( Gio.AsyncResult) – aGio.AsyncResultReturns: a Gio.IOStream.Return type: Gio.IOStreamSee
Gio.Proxy.connect().New in version 2.26.
-
do_supports_hostname() virtual¶ Returns: Trueif hostname resolution is supported.Return type: boolSome 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
Falseif proxy is implementing such a protocol. WhenFalseis returned, the caller should resolve the destination hostname first, and then pass aGio.ProxyAddresscontaining the stringified IP address toGio.Proxy.connect() orGio.Proxy.connect_async().New in version 2.26.
-
classmethod