Gio.ProxyResolver¶
- Implementations:
Methods¶
class |
|
|
|
|
|
|
|
|
Virtual Methods¶
|
|
|
|
|
Properties¶
None
Signals¶
None
Fields¶
None
Class Details¶
- class Gio.ProxyResolver¶
- Bases:
- Structure:
GProxyResolver
provides synchronous and asynchronous network proxy resolution.GProxyResolver
is used within [class`Gio`.SocketClient] through the method [method`Gio`.SocketConnectable.proxy_enumerate].Implementations of
GProxyResolver
based 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
, which will be a dummy object if no proxy resolver is available- Return type:
Gets the default
Gio.ProxyResolver
for the system.New in version 2.26.
- is_supported()[source]¶
-
Checks if self can be used on this system. (This is used internally;
Gio.ProxyResolver.get_default
() will only return a proxy resolver that returnsTrue
for this method.)New in version 2.26.
- lookup(uri, cancellable)[source]¶
- Parameters:
uri (
str
) – a URI representing the destination to connect tocancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
- Raises:
- Returns:
A
None
-terminated array of proxy URIs. Must be freed withGLib.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[:port]
ordirect://
, 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
none
as 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.
- lookup_async(uri, cancellable, callback, *user_data)[source]¶
- Parameters:
uri (
str
) – a URI representing the destination to connect tocancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – callback to call after resolution completes
Asynchronous lookup of proxy. See
Gio.ProxyResolver.lookup
() for more details.New in version 2.26.
- lookup_finish(result)[source]¶
- Parameters:
result (
Gio.AsyncResult
) – the result passed to yourGio.AsyncReadyCallback
- Raises:
- Returns:
A
None
-terminated array of proxy URIs. Must be freed withGLib.strfreev
().- Return type:
[
str
]
Call this function to obtain the array of proxy URIs when
Gio.ProxyResolver.lookup_async
() is complete. SeeGio.ProxyResolver.lookup
() for more details.New in version 2.26.
- do_is_supported() virtual¶
-
Checks if resolver can be used on this system. (This is used internally;
Gio.ProxyResolver.get_default
() will only return a proxy resolver that returnsTrue
for this method.)New in version 2.26.
- do_lookup(uri, cancellable) virtual¶
- Parameters:
uri (
str
) – a URI representing the destination to connect tocancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
- Returns:
A
None
-terminated array of proxy URIs. Must be freed withGLib.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[:port]
ordirect://
, 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
none
as 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.
- do_lookup_async(uri, cancellable, callback, *user_data) virtual¶
- Parameters:
uri (
str
) – a URI representing the destination to connect tocancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – callback to call after resolution completes
Asynchronous lookup of proxy. See
Gio.ProxyResolver.lookup
() for more details.New in version 2.26.
- do_lookup_finish(result) virtual¶
- Parameters:
result (
Gio.AsyncResult
) – the result passed to yourGio.AsyncReadyCallback
- Returns:
A
None
-terminated array of proxy URIs. Must be freed withGLib.strfreev
().- Return type:
[
str
]
Call this function to obtain the array of proxy URIs when
Gio.ProxyResolver.lookup_async
() is complete. SeeGio.ProxyResolver.lookup
() for more details.New in version 2.26.