Gio.ProxyResolver¶
| Implementations: | |
|---|---|
| Gio.SimpleProxyResolver | |
Methods¶
| class | get_default() | 
| is_supported() | |
| lookup(uri, cancellable) | |
| lookup_async(uri, cancellable, callback, *user_data) | |
| lookup_finish(result) | 
Virtual Methods¶
| do_is_supported() | |
| do_lookup(uri, cancellable) | |
| do_lookup_async(uri, cancellable, callback, *user_data) | |
| do_lookup_finish(result) | 
Properties¶
None
Signals¶
None
Fields¶
None
Class Details¶
- 
class Gio.ProxyResolver¶
- Bases: - GObject.GInterface- Structure: - Gio.ProxyResolverInterface- Gio.ProxyResolverprovides synchronous and asynchronous network proxy resolution.- Gio.ProxyResolveris used within- Gio.SocketClientthrough the method- Gio.SocketConnectable.proxy_enumerate().- Implementations of - Gio.ProxyResolverbased on libproxy and GNOME settings can be found in glib-networking. GIO comes with an implementation for use inside Flatpak portals.- New in version 2.26. - 
classmethod get_default()[source]¶
- Returns: - the default - Gio.ProxyResolver.- Return type: - Gio.ProxyResolver- Gets the default - Gio.ProxyResolverfor the system.- New in version 2.26. 
 - 
is_supported()[source]¶
- Returns: - Trueif self is supported.- Return type: - bool- Checks if self can be used on this system. (This is used internally; - Gio.ProxyResolver.get_default() will only return a proxy resolver that returns- Truefor this method.)- New in version 2.26. 
 - 
lookup(uri, cancellable)[source]¶
- Parameters: - uri (str) – a URI representing the destination to connect to
- cancellable (Gio.CancellableorNone) – aGio.Cancellable, orNone
 - Raises: - Returns: - A - None-terminated array of proxy URIs. Must be freed with- GLib.strfreev().- Return type: - [ - str]- Looks into the system proxy configuration to determine what proxy, if any, to use to connect to uri. The returned proxy URIs are of the form - <protocol>://[user[:password]@]host:portor- direct://, where <protocol> could be http, rtsp, socks or other proxying protocol.- If you don’t know what network protocol is being used on the socket, you should use - noneas the URI protocol. In this case, the resolver might still return a generic proxy type (such as SOCKS), but would not return protocol-specific proxy types (such as http).- direct://is used when no proxy is needed. Direct connection should not be attempted unless it is part of the returned array of proxies.- New in version 2.26. 
- uri (
 - 
lookup_async(uri, cancellable, callback, *user_data)[source]¶
- Parameters: - uri (str) – a URI representing the destination to connect to
- cancellable (Gio.CancellableorNone) – aGio.Cancellable, orNone
- callback (Gio.AsyncReadyCallbackorNone) – callback to call after resolution completes
- user_data (objectorNone) – data for callback
 - Asynchronous lookup of proxy. See - Gio.ProxyResolver.lookup() for more details.- New in version 2.26. 
- uri (
 - 
lookup_finish(result)[source]¶
- Parameters: - result ( - Gio.AsyncResult) – the result passed to your- Gio.AsyncReadyCallback- Raises: - GLib.Error- Returns: - A - None-terminated array of proxy URIs. Must be freed with- GLib.strfreev().- Return type: - [ - str]- Call this function to obtain the array of proxy URIs when - Gio.ProxyResolver.lookup_async() is complete. See- Gio.ProxyResolver.lookup() for more details.- New in version 2.26. 
 - 
do_is_supported() virtual¶
- Returns: - Trueif resolver is supported.- Return type: - bool- Checks if resolver can be used on this system. (This is used internally; - Gio.ProxyResolver.get_default() will only return a proxy resolver that returns- Truefor this method.)- New in version 2.26. 
 - 
do_lookup(uri, cancellable) virtual¶
- Parameters: - uri (str) – a URI representing the destination to connect to
- cancellable (Gio.CancellableorNone) – aGio.Cancellable, orNone
 - Returns: - A - None-terminated array of proxy URIs. Must be freed with- GLib.strfreev().- Return type: - [ - str]- Looks into the system proxy configuration to determine what proxy, if any, to use to connect to uri. The returned proxy URIs are of the form - <protocol>://[user[:password]@]host:portor- direct://, where <protocol> could be http, rtsp, socks or other proxying protocol.- If you don’t know what network protocol is being used on the socket, you should use - noneas the URI protocol. In this case, the resolver might still return a generic proxy type (such as SOCKS), but would not return protocol-specific proxy types (such as http).- direct://is used when no proxy is needed. Direct connection should not be attempted unless it is part of the returned array of proxies.- New in version 2.26. 
- uri (
 - 
do_lookup_async(uri, cancellable, callback, *user_data) virtual¶
- Parameters: - uri (str) – a URI representing the destination to connect to
- cancellable (Gio.CancellableorNone) – aGio.Cancellable, orNone
- callback (Gio.AsyncReadyCallbackorNone) – callback to call after resolution completes
- user_data (objectorNone) – data for callback
 - Asynchronous lookup of proxy. See - Gio.ProxyResolver.lookup() for more details.- New in version 2.26. 
- uri (
 - 
do_lookup_finish(result) virtual¶
- Parameters: - result ( - Gio.AsyncResult) – the result passed to your- Gio.AsyncReadyCallback- Returns: - A - None-terminated array of proxy URIs. Must be freed with- GLib.strfreev().- Return type: - [ - str]- Call this function to obtain the array of proxy URIs when - Gio.ProxyResolver.lookup_async() is complete. See- Gio.ProxyResolver.lookup() for more details.- New in version 2.26. 
 
- 
classmethod