Gio.Proxy¶
- Implementations:
None
Methods¶
class |
|
|
|
|
|
|
|
Virtual Methods¶
|
|
|
|
|
|
Properties¶
None
Signals¶
None
Fields¶
None
Class Details¶
- class Gio.Proxy¶
- Bases:
- Structure:
A
GProxy
handles connecting to a remote host via a given type of proxy server. It is implemented by thegio-proxy
extension point. The extensions are named after their proxy protocol name. As an example, a SOCKS5 proxy implementation can be retrieved with the namesocks5
using the function [method`Gio`.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 type:
Find the
gio-proxy
extension 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.Cancellable
orNone
) – aGio.Cancellable
- Raises:
- Returns:
a
Gio.IOStream
that 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.SocketConnection
that is connected to the proxy server), this does the necessary handshake to connect to proxy_address, and if required, wraps theGio.IOStream
to handle proxy payload.New in version 2.26.
- connect_async(connection, proxy_address, cancellable, callback, *user_data)[source]¶
- Parameters:
connection (
Gio.IOStream
) – aGio.IOStream
proxy_address (
Gio.ProxyAddress
) – aGio.ProxyAddress
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
Asynchronous version of
Gio.Proxy.connect
().New in version 2.26.
- connect_finish(result)[source]¶
- Parameters:
result (
Gio.AsyncResult
) – aGio.AsyncResult
- Raises:
- Returns:
a
Gio.IOStream
.- Return type:
See
Gio.Proxy.connect
().New in version 2.26.
- supports_hostname()[source]¶
-
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 self is implementing such a protocol. WhenFalse
is returned, the caller should resolve the destination hostname first, and then pass aGio.ProxyAddress
containing 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.Cancellable
orNone
) – aGio.Cancellable
- Returns:
a
Gio.IOStream
that 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.SocketConnection
that is connected to the proxy server), this does the necessary handshake to connect to proxy_address, and if required, wraps theGio.IOStream
to handle proxy payload.New in version 2.26.
- 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.Cancellable
orNone
) – aGio.Cancellable
callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
Asynchronous version of
Gio.Proxy.connect
().New in version 2.26.
- do_connect_finish(result) virtual¶
- Parameters:
result (
Gio.AsyncResult
) – aGio.AsyncResult
- Returns:
a
Gio.IOStream
.- Return type:
See
Gio.Proxy.connect
().New in version 2.26.
- do_supports_hostname() virtual¶
-
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. WhenFalse
is returned, the caller should resolve the destination hostname first, and then pass aGio.ProxyAddress
containing the stringified IP address toGio.Proxy.connect
() orGio.Proxy.connect_async
().New in version 2.26.