:right-sidebar: True SimpleProxyResolver =================================================================== .. currentmodule:: gi.repository.Gio .. versionadded:: 2.36 .. class:: SimpleProxyResolver(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gio.ProxyResolver` :Constructors: :: SimpleProxyResolver(**properties) Methods ------- .. rst-class:: interim-class .. class:: SimpleProxyResolver :no-index: .. method:: new(default_proxy: str | None = None, ignore_hosts: ~typing.Sequence[str] | None = None) -> ~gi.repository.Gio.ProxyResolver Creates a new :obj:`~gi.repository.Gio.SimpleProxyResolver`. See :obj:`~gi.repository.Gio.SimpleProxyResolver`:default-proxy and :obj:`~gi.repository.Gio.SimpleProxyResolver`:ignore-hosts for more details on how the arguments are interpreted. .. versionadded:: 2.36 :param default_proxy: the default proxy to use, eg "socks://192.168.1.1" :param ignore_hosts: an optional list of hosts/IP addresses to not use a proxy for. .. method:: set_default_proxy(default_proxy: str | None = None) -> None Sets the default proxy on ``resolver``, to be used for any URIs that don't match :obj:`~gi.repository.Gio.SimpleProxyResolver`:ignore-hosts or a proxy set via :func:`~gi.repository.Gio.SimpleProxyResolver.set_uri_proxy`. If ``default_proxy`` starts with "socks://", :obj:`~gi.repository.Gio.SimpleProxyResolver` will treat it as referring to all three of the socks5, socks4a, and socks4 proxy types. .. versionadded:: 2.36 :param default_proxy: the default proxy to use .. method:: set_ignore_hosts(ignore_hosts: ~typing.Sequence[str]) -> None Sets the list of ignored hosts. See :obj:`~gi.repository.Gio.SimpleProxyResolver`:ignore-hosts for more details on how the ``ignore_hosts`` argument is interpreted. .. versionadded:: 2.36 :param ignore_hosts: :const:`None`-terminated list of hosts/IP addresses to not use a proxy for .. method:: set_uri_proxy(uri_scheme: str, proxy: str) -> None Adds a URI-scheme-specific proxy to ``resolver``; URIs whose scheme matches ``uri_scheme`` (and which don't match :obj:`~gi.repository.Gio.SimpleProxyResolver`:ignore-hosts) will be proxied via ``proxy``. As with :obj:`~gi.repository.Gio.SimpleProxyResolver`:default-proxy, if ``proxy`` starts with "socks://", :obj:`~gi.repository.Gio.SimpleProxyResolver` will treat it as referring to all three of the socks5, socks4a, and socks4 proxy types. .. versionadded:: 2.36 :param uri_scheme: the URI scheme to add a proxy for :param proxy: the proxy to use for ``uri_scheme`` Properties ---------- .. rst-class:: interim-class .. class:: SimpleProxyResolver :no-index: .. attribute:: props.default_proxy :type: str The default proxy URI that will be used for any URI that doesn't match :obj:`~gi.repository.Gio.SimpleProxyResolver`:ignore-hosts, and doesn't match any of the schemes set with :func:`~gi.repository.Gio.SimpleProxyResolver.set_uri_proxy`. Note that as a special case, if this URI starts with "socks://", :obj:`~gi.repository.Gio.SimpleProxyResolver` will treat it as referring to all three of the socks5, socks4a, and socks4 proxy types. .. attribute:: props.ignore_hosts :type: ~typing.Sequence[str] A list of hostnames and IP addresses that the resolver should allow direct connections to. Entries can be in one of 4 formats: - A hostname, such as "example.com", ".example.com", or "*.example.com", any of which match "example.com" or any subdomain of it. - An IPv4 or IPv6 address, such as "192.168.1.1", which matches only that address. - A hostname or IP address followed by a port, such as "example.com:80", which matches whatever the hostname or IP address would match, but only for URLs with the (explicitly) indicated port. In the case of an IPv6 address, the address part must appear in brackets: "[::1]:443" - An IP address range, given by a base address and prefix length, such as "fe80::/10", which matches any address in that range. Note that when dealing with Unicode hostnames, the matching is done against the ASCII form of the name. Also note that hostname exclusions apply only to connections made to hosts identified by name, and IP address exclusions apply only to connections made to hosts identified by address. That is, if example.com has an address of 192.168.1.1, and the :ignore-hosts list contains only "192.168.1.1", then a connection to "example.com" (eg, via a :obj:`~gi.repository.Gio.NetworkAddress`) will use the proxy, and a connection to "192.168.1.1" (eg, via a :obj:`~gi.repository.Gio.InetSocketAddress`) will not. These rules match the "ignore-hosts"/"noproxy" rules most commonly used by other applications. Fields ------ .. rst-class:: interim-class .. class:: SimpleProxyResolver :no-index: .. attribute:: parent_instance .. attribute:: priv