Class SimpleProxyResolver
- All Implemented Interfaces:
ProxyResolver, Proxy
GSimpleProxyResolver is a simple ProxyResolver implementation
that handles a single default proxy, multiple URI-scheme-specific
proxies, and a list of hosts that proxies should not be used for.
GSimpleProxyResolver is never the default proxy resolver, but it
can be used as the base class for another proxy resolver
implementation, or it can be created and used manually, such as
with SocketClient.setProxyResolver(ProxyResolver).
- Since:
- 2.36
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classInner class implementing a builder pattern to construct a GObject with properties.static classNested classes/interfaces inherited from class GObject
GObject.NotifyCallback, GObject.ObjectClassNested classes/interfaces inherited from interface ProxyResolver
ProxyResolver.ProxyResolver$Impl, ProxyResolver.ProxyResolverInterface -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new SimpleProxyResolver.SimpleProxyResolver(MemorySegment address) Create a SimpleProxyResolver instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected SimpleProxyResolverasParent()Return this instance as if it were its parent type.static SimpleProxyResolver.Builder<? extends SimpleProxyResolver.Builder> builder()ASimpleProxyResolver.Builderobject constructs aSimpleProxyResolverwith the specified properties.static MemoryLayoutThe memory layout of the native struct.static @Nullable TypegetType()Get the GType of the SimpleProxyResolver class.static ProxyResolverCreates a newGSimpleProxyResolver.voidsetDefaultProxy(@Nullable String defaultProxy) Sets the default proxy onresolver,to be used for any URIs that don't matchGSimpleProxyResolver:ignore-hosts or a proxy set via g_simple_proxy_resolver_set_uri_proxy().voidsetIgnoreHosts(@Nullable String @Nullable [] ignoreHosts) Sets the list of ignored hosts.voidsetUriProxy(String uriScheme, String proxy) Adds a URI-scheme-specific proxy toresolver;URIs whose scheme matchesuriScheme(and which don't matchGSimpleProxyResolver:ignore-hosts) will be proxied viaproxy.Methods inherited from class GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newv, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withPropertiesMethods inherited from class TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class ProxyInstance
equals, handle, hashCodeMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ProxyResolver
isSupported, lookup, lookupAsync, lookupFinish
-
Constructor Details
-
SimpleProxyResolver
Create a SimpleProxyResolver instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
SimpleProxyResolver
public SimpleProxyResolver()Create a new SimpleProxyResolver.
-
-
Method Details
-
getType
Get the GType of the SimpleProxyResolver class.- Returns:
- the GType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
asParent
Return this instance as if it were its parent type. Comparable to the Javasuperkeyword, but ensures the parent typeclass is also used in native code. -
new_
public static ProxyResolver new_(@Nullable String defaultProxy, @Nullable String @Nullable [] ignoreHosts) Creates a newGSimpleProxyResolver. SeeGSimpleProxyResolver:default-proxy andGSimpleProxyResolver:ignore-hosts for more details on how the arguments are interpreted.- Parameters:
defaultProxy- the default proxy to use, eg "socks://192.168.1.1"ignoreHosts- an optional list of hosts/IP addresses to not use a proxy for.- Returns:
- a new
GSimpleProxyResolver - Since:
- 2.36
-
setDefaultProxy
Sets the default proxy on
resolver,to be used for any URIs that don't matchGSimpleProxyResolver:ignore-hosts or a proxy set via g_simple_proxy_resolver_set_uri_proxy().If
defaultProxystarts with "socks://",GSimpleProxyResolverwill treat it as referring to all three of the socks5, socks4a, and socks4 proxy types.- Parameters:
defaultProxy- the default proxy to use- Since:
- 2.36
-
setIgnoreHosts
Sets the list of ignored hosts.
See
GSimpleProxyResolver:ignore-hosts for more details on how theignoreHostsargument is interpreted.- Parameters:
ignoreHosts-null-terminated list of hosts/IP addresses to not use a proxy for- Since:
- 2.36
-
setUriProxy
Adds a URI-scheme-specific proxy to
resolver;URIs whose scheme matchesuriScheme(and which don't matchGSimpleProxyResolver:ignore-hosts) will be proxied viaproxy.As with
GSimpleProxyResolver:default-proxy, ifproxystarts with "socks://",GSimpleProxyResolverwill treat it as referring to all three of the socks5, socks4a, and socks4 proxy types.- Parameters:
uriScheme- the URI scheme to add a proxy forproxy- the proxy to use foruriScheme- Since:
- 2.36
-
builder
ASimpleProxyResolver.Builderobject constructs aSimpleProxyResolverwith the specified properties. Use the variousset...()methods to set properties, and finish construction withSimpleProxyResolver.Builder.build().- Returns:
- the builder object
-