Class SimpleProxyResolver.Builder<B extends SimpleProxyResolver.Builder<B>>
- Type Parameters:
B
- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
- Enclosing class:
SimpleProxyResolver
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Finish building theSimpleProxyResolver
object.setDefaultProxy
(String defaultProxy) The default proxy URI that will be used for any URI that doesn't matchGSimpleProxyResolver
:ignore-hosts, and doesn't match any of the schemes set with g_simple_proxy_resolver_set_uri_proxy().setIgnoreHosts
(String[] ignoreHosts) A list of hostnames and IP addresses that the resolver should allow direct connections to.Methods inherited from class org.gnome.gobject.GObject.Builder
onNotify
Methods inherited from class io.github.jwharm.javagi.gobject.Builder
addBuilderProperty, connect, connect, connectSignals, getArena, getNames, getValues
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilder
object.
-
-
Method Details
-
build
Finish building theSimpleProxyResolver
object. This will callGObject.withProperties(org.gnome.glib.Type, java.lang.String[], org.gnome.gobject.Value[])
to create a new GObject instance, which is then cast toSimpleProxyResolver
.- Overrides:
build
in classGObject.Builder<B extends SimpleProxyResolver.Builder<B>>
- Returns:
- a new instance of
SimpleProxyResolver
with the properties that were set in the Builder object.
-
setDefaultProxy
The default proxy URI that will be used for any URI that doesn't matchGSimpleProxyResolver
:ignore-hosts, and doesn't match any of the schemes set with g_simple_proxy_resolver_set_uri_proxy().Note that as a special case, if this URI starts with "socks://",
GSimpleProxyResolver
will treat it as referring to all three of the socks5, socks4a, and socks4 proxy types.- Parameters:
defaultProxy
- the value for thedefault-proxy
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setIgnoreHosts
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
GNetworkAddress
) will use the proxy, and a connection to "192.168.1.1" (eg, via aGInetSocketAddress
) will not.These rules match the "ignore-hosts"/"noproxy" rules most commonly used by other applications.
- Parameters:
ignoreHosts
- the value for theignore-hosts
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-