Class NetworkProxySettings
- All Implemented Interfaces:
Proxy
WebKitNetworkProxySettings can be used to provide a custom proxy configuration
to a WebKitWebContext
. You need to call webkit_web_context_set_network_proxy_settings()
with NetworkProxyMode.CUSTOM
and a WebKitNetworkProxySettings.
-
Constructor Summary
ConstructorDescriptionNetworkProxySettings
(@Nullable String defaultProxyUri, @Nullable String[] ignoreHosts) Create a newWebKitNetworkProxySettings
with the givendefaultProxyUri
andignoreHosts
.NetworkProxySettings
(MemorySegment address) Create a NetworkProxySettings proxy instance for the provided memory address. -
Method Summary
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
NetworkProxySettings
Create a NetworkProxySettings proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
NetworkProxySettings
public NetworkProxySettings(@Nullable @Nullable String defaultProxyUri, @Nullable @Nullable String[] ignoreHosts) throws UnsupportedPlatformException Create a newWebKitNetworkProxySettings
with the givendefaultProxyUri
andignoreHosts
.The default proxy URI will be used for any URI that doesn't match
ignoreHosts
, and doesn't match any of the schemes added with webkit_network_proxy_settings_add_proxy_for_scheme(). IfdefaultProxyUri
starts with "socks://", it will be treated as referring to all three of the socks5, socks4a, and socks4 proxy types.ignoreHosts
is a list of hostnames and IP addresses that the resolver should allow direct connections to. Entries can be in one of 4 formats: <itemizedlist> <listitem><para> A hostname, such as "example.com", ".example.com", or "*.example.com", any of which match "example.com" or any subdomain of it. </para></listitem> <listitem><para> An IPv4 or IPv6 address, such as "192.168.1.1", which matches only that address. </para></listitem> <listitem><para> 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" </para></listitem> <listitem><para> An IP address range, given by a base address and prefix length, such as "fe80::/10", which matches any address in that range. </para></listitem> </itemizedlist>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
ignoreHosts
contains only "192.168.1.1", then a connection to "example.com" will use the proxy, and a connection to 192.168.1.1" will not.- Parameters:
defaultProxyUri
- the default proxy URI to use, ornull
.ignoreHosts
- an optional list of hosts/IP addresses to not use a proxy for.- Throws:
UnsupportedPlatformException
- when run on a platform other than linux
-
-
Method Details
-
getType
-
addProxyForScheme
Adds a URI-scheme-specific proxy.URIs whose scheme matches
uriScheme
will be proxied viaproxyUri
. As with the default proxy URI, ifproxyUri
starts with "socks://", it will be treated as referring to all three of the socks5, socks4a, and socks4 proxy types.- Parameters:
scheme
- the URI scheme to add a proxy forproxyUri
- the proxy URI to use foruriScheme
-
copy
Make a copy of theWebKitNetworkProxySettings
.- Returns:
- A copy of passed in
WebKitNetworkProxySettings
-
free
public void free()Free theWebKitNetworkProxySettings
.
-