gi-gio-2.0.38: Gio bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gio.Objects.SimpleProxyResolver

Contents

- Exported types
- Methods
  - new
  - setDefaultProxy
  - setIgnoreHosts
  - setUriProxy
- Properties
  - defaultProxy
  - ignoreHosts

Description

`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.

Constructors

SimpleProxyResolver (ManagedPtr SimpleProxyResolver) |

#### Instances

Instances details

Eq SimpleProxyResolver Source # |
Instance details Defined in GI.Gio.Objects.SimpleProxyResolver Methods (==) :: SimpleProxyResolver -> SimpleProxyResolver -> Bool Source # (/=) :: SimpleProxyResolver -> SimpleProxyResolver -> Bool Source #
GObject SimpleProxyResolver Source # |
Instance details Defined in GI.Gio.Objects.SimpleProxyResolver
ManagedPtrNewtype SimpleProxyResolver Source # |
Instance details Defined in GI.Gio.Objects.SimpleProxyResolver Methods toManagedPtr :: SimpleProxyResolver -> ManagedPtr SimpleProxyResolver Source #
TypedObject SimpleProxyResolver Source # |
Instance details Defined in GI.Gio.Objects.SimpleProxyResolver Methods glibType :: IO GType Source #
HasParentTypes SimpleProxyResolver Source # |
Instance details Defined in GI.Gio.Objects.SimpleProxyResolver
IsGValue (Maybe SimpleProxyResolver) Source # | Convert `SimpleProxyResolver` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gio.Objects.SimpleProxyResolver Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe SimpleProxyResolver -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe SimpleProxyResolver) Source #
type ParentTypes SimpleProxyResolver Source # |
Instance details Defined in GI.Gio.Objects.SimpleProxyResolver type ParentTypes SimpleProxyResolver = '[Object, ProxyResolver]

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

Instances details

(GObject o, IsDescendantOf SimpleProxyResolver o) => IsSimpleProxyResolver o Source # |
Instance details 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

Expand

#### 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 #

Arguments

:: (HasCallStack, MonadIO m) |
=> Maybe Text | `defaultProxy`: the default proxy to use, eg "socks://192.168.1.1"
-> Maybe [Text] | `ignoreHosts`: an optional list of hosts/IP addresses to not use a proxy for.
-> m ProxyResolver | Returns: a new `SimpleProxyResolver`

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 #

Arguments

:: (HasCallStack, MonadIO m, IsSimpleProxyResolver a) |
=> a | `resolver`: a `SimpleProxyResolver`
-> Maybe Text | `defaultProxy`: the default proxy to use
-> 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 #

Arguments

:: (HasCallStack, MonadIO m, IsSimpleProxyResolver a) |
=> a | `resolver`: a `SimpleProxyResolver`
-> [Text] | `ignoreHosts`: `Nothing`-terminated list of hosts/IP addresses to not use a proxy for
-> 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 #

Arguments

:: (HasCallStack, MonadIO m, IsSimpleProxyResolver a) |
=> a | `resolver`: a `SimpleProxyResolver`
-> Text | `uriScheme`: the URI scheme to add a proxy for
-> Text | `proxy`: the proxy to use for `uriScheme`
-> 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 ]