Gio.Proxy¶
- Implementations:
 None
Methods¶
class  | 
  | 
  | 
|
  | 
|
  | 
|
Virtual Methods¶
  | 
|
  | 
|
  | 
|
Properties¶
None
Signals¶
None
Fields¶
None
Class Details¶
- class Gio.Proxy¶
 - Bases:
 - Structure:
 
A
GProxyhandles connecting to a remote host via a given type of proxy server. It is implemented by thegio-proxyextension point. The extensions are named after their proxy protocol name. As an example, a SOCKS5 proxy implementation can be retrieved with the namesocks5using 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-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.IOStreamproxy_address (
Gio.ProxyAddress) – aGio.ProxyAddresscancellable (
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.
- connect_async(connection, proxy_address, cancellable, callback, *user_data)[source]¶
 - Parameters:
 connection (
Gio.IOStream) – aGio.IOStreamproxy_address (
Gio.ProxyAddress) – aGio.ProxyAddresscancellable (
Gio.CancellableorNone) – aGio.Cancellablecallback (
Gio.AsyncReadyCallbackorNone) – 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
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.IOStreamproxy_address (
Gio.ProxyAddress) – aGio.ProxyAddresscancellable (
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.
- do_connect_async(connection, proxy_address, cancellable, callback, *user_data) virtual¶
 - Parameters:
 connection (
Gio.IOStream) – aGio.IOStreamproxy_address (
Gio.ProxyAddress) – aGio.ProxyAddresscancellable (
Gio.CancellableorNone) – aGio.Cancellablecallback (
Gio.AsyncReadyCallbackorNone) – 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
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.