Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
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 socketClientSetProxyResolver
.
Since: 2.36
Synopsis
- newtype SimpleProxyResolver = SimpleProxyResolver (ManagedPtr SimpleProxyResolver)
- class (GObject o, IsDescendantOf SimpleProxyResolver o) => IsSimpleProxyResolver o
- toSimpleProxyResolver :: (MonadIO m, IsSimpleProxyResolver o) => o -> m SimpleProxyResolver
- simpleProxyResolverNew :: (HasCallStack, MonadIO m) => Maybe Text -> Maybe [Text] -> m ProxyResolver
- simpleProxyResolverSetDefaultProxy :: (HasCallStack, MonadIO m, IsSimpleProxyResolver a) => a -> Maybe Text -> m ()
- simpleProxyResolverSetIgnoreHosts :: (HasCallStack, MonadIO m, IsSimpleProxyResolver a) => a -> [Text] -> m ()
- simpleProxyResolverSetUriProxy :: (HasCallStack, MonadIO m, IsSimpleProxyResolver a) => a -> Text -> Text -> m ()
- clearSimpleProxyResolverDefaultProxy :: (MonadIO m, IsSimpleProxyResolver o) => o -> m ()
- constructSimpleProxyResolverDefaultProxy :: (IsSimpleProxyResolver o, MonadIO m) => Text -> m (GValueConstruct o)
- getSimpleProxyResolverDefaultProxy :: (MonadIO m, IsSimpleProxyResolver o) => o -> m (Maybe Text)
- setSimpleProxyResolverDefaultProxy :: (MonadIO m, IsSimpleProxyResolver o) => o -> Text -> m ()
- constructSimpleProxyResolverIgnoreHosts :: (IsSimpleProxyResolver o, MonadIO m) => [Text] -> m (GValueConstruct o)
- getSimpleProxyResolverIgnoreHosts :: (MonadIO m, IsSimpleProxyResolver o) => o -> m (Maybe [Text])
- setSimpleProxyResolverIgnoreHosts :: (MonadIO m, IsSimpleProxyResolver o) => o -> [Text] -> m ()
Exported types
newtype SimpleProxyResolver Source #
Memory-managed wrapper type.
Instances
Eq SimpleProxyResolver Source # | |
Defined in GI.Gio.Objects.SimpleProxyResolver (==) :: SimpleProxyResolver -> SimpleProxyResolver -> Bool # (/=) :: SimpleProxyResolver -> SimpleProxyResolver -> Bool # | |
GObject SimpleProxyResolver Source # | |
Defined in GI.Gio.Objects.SimpleProxyResolver | |
ManagedPtrNewtype SimpleProxyResolver Source # | |
TypedObject SimpleProxyResolver Source # | |
Defined in GI.Gio.Objects.SimpleProxyResolver | |
HasParentTypes SimpleProxyResolver Source # | |
Defined in GI.Gio.Objects.SimpleProxyResolver | |
IsGValue (Maybe SimpleProxyResolver) Source # | Convert |
Defined in GI.Gio.Objects.SimpleProxyResolver gvalueGType_ :: IO GType # gvalueSet_ :: Ptr GValue -> Maybe SimpleProxyResolver -> IO () # gvalueGet_ :: Ptr GValue -> IO (Maybe SimpleProxyResolver) # | |
type ParentTypes SimpleProxyResolver Source # | |
Defined in GI.Gio.Objects.SimpleProxyResolver |
class (GObject o, IsDescendantOf SimpleProxyResolver o) => IsSimpleProxyResolver o Source #
Type class for types which can be safely cast to SimpleProxyResolver
, for instance with toSimpleProxyResolver
.
Instances
(GObject o, IsDescendantOf SimpleProxyResolver o) => IsSimpleProxyResolver o Source # | |
Defined in GI.Gio.Objects.SimpleProxyResolver |
toSimpleProxyResolver :: (MonadIO m, IsSimpleProxyResolver o) => o -> m SimpleProxyResolver Source #
Cast to SimpleProxyResolver
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, isSupported, lookup, lookupAsync, lookupFinish, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getData, getProperty, getQdata.
Setters
setData, setDataFull, setDefaultProxy, setIgnoreHosts, setProperty, setUriProxy.
new
simpleProxyResolverNew Source #
:: (HasCallStack, MonadIO m) | |
=> Maybe Text |
|
-> Maybe [Text] |
|
-> m ProxyResolver | Returns: a new |
Creates a new SimpleProxyResolver
. See
SimpleProxyResolver:defaultProxy and
SimpleProxyResolver:ignoreHosts for more details on how the
arguments are interpreted.
Since: 2.36
setDefaultProxy
simpleProxyResolverSetDefaultProxy Source #
:: (HasCallStack, MonadIO m, IsSimpleProxyResolver a) | |
=> a |
|
-> Maybe Text |
|
-> m () |
Sets the default proxy on resolver
, to be used for any URIs that
don't match SimpleProxyResolver:ignoreHosts or a proxy set
via simpleProxyResolverSetUriProxy
.
If defaultProxy
starts with "socks://",
SimpleProxyResolver
will treat it as referring to all three of
the socks5, socks4a, and socks4 proxy types.
Since: 2.36
setIgnoreHosts
simpleProxyResolverSetIgnoreHosts Source #
:: (HasCallStack, MonadIO m, IsSimpleProxyResolver a) | |
=> a |
|
-> [Text] |
|
-> m () |
Sets the list of ignored hosts.
See SimpleProxyResolver:ignoreHosts for more details on how the
ignoreHosts
argument is interpreted.
Since: 2.36
setUriProxy
simpleProxyResolverSetUriProxy Source #
:: (HasCallStack, MonadIO m, IsSimpleProxyResolver a) | |
=> a |
|
-> Text |
|
-> Text |
|
-> m () |
Adds a URI-scheme-specific proxy to resolver
; URIs whose scheme
matches uriScheme
(and which don't match
SimpleProxyResolver:ignoreHosts) will be proxied via proxy
.
As with SimpleProxyResolver:defaultProxy, if proxy
starts with
"socks://", SimpleProxyResolver
will treat it
as referring to all three of the socks5, socks4a, and socks4 proxy
types.
Since: 2.36
Properties
defaultProxy
The default proxy URI that will be used for any URI that doesn't
match SimpleProxyResolver:ignoreHosts, and doesn't match any
of the schemes set with simpleProxyResolverSetUriProxy
.
Note that as a special case, if this URI starts with
"socks://", SimpleProxyResolver
will treat it as referring
to all three of the socks5, socks4a, and socks4 proxy types.
clearSimpleProxyResolverDefaultProxy :: (MonadIO m, IsSimpleProxyResolver o) => o -> m () Source #
Set the value of the “default-proxy
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#defaultProxy
constructSimpleProxyResolverDefaultProxy :: (IsSimpleProxyResolver o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “default-proxy
” property. This is rarely needed directly, but it is used by new
.
getSimpleProxyResolverDefaultProxy :: (MonadIO m, IsSimpleProxyResolver o) => o -> m (Maybe Text) Source #
Get the value of the “default-proxy
” property.
When overloading is enabled, this is equivalent to
get
simpleProxyResolver #defaultProxy
setSimpleProxyResolverDefaultProxy :: (MonadIO m, IsSimpleProxyResolver o) => o -> Text -> m () Source #
Set the value of the “default-proxy
” property.
When overloading is enabled, this is equivalent to
set
simpleProxyResolver [ #defaultProxy:=
value ]
ignoreHosts
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 NetworkAddress
) will use the proxy, and a connection to
"192.168.1.1" (eg, via a InetSocketAddress
) will not.
These rules match the "ignore-hosts"/"noproxy" rules most commonly used by other applications.
constructSimpleProxyResolverIgnoreHosts :: (IsSimpleProxyResolver o, MonadIO m) => [Text] -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “ignore-hosts
” property. This is rarely needed directly, but it is used by new
.
getSimpleProxyResolverIgnoreHosts :: (MonadIO m, IsSimpleProxyResolver o) => o -> m (Maybe [Text]) Source #
Get the value of the “ignore-hosts
” property.
When overloading is enabled, this is equivalent to
get
simpleProxyResolver #ignoreHosts
setSimpleProxyResolverIgnoreHosts :: (MonadIO m, IsSimpleProxyResolver o) => o -> [Text] -> m () Source #
Set the value of the “ignore-hosts
” property.
When overloading is enabled, this is equivalent to
set
simpleProxyResolver [ #ignoreHosts:=
value ]