gi-gio-2.0.30: Gio bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gio.Interfaces.ProxyResolver

Description

ProxyResolver provides synchronous and asynchronous network proxy resolution. ProxyResolver is used within SocketClient through the method socketConnectableProxyEnumerate.

Implementations of ProxyResolver based on libproxy and GNOME settings can be found in glib-networking. GIO comes with an implementation for use inside Flatpak portals.

Since: 2.26

Synopsis

Exported types

newtype ProxyResolver Source #

Memory-managed wrapper type.

Constructors

ProxyResolver (ManagedPtr ProxyResolver) 

Instances

Instances details
Eq ProxyResolver Source # 
Instance details

Defined in GI.Gio.Interfaces.ProxyResolver

GObject ProxyResolver Source # 
Instance details

Defined in GI.Gio.Interfaces.ProxyResolver

ManagedPtrNewtype ProxyResolver Source # 
Instance details

Defined in GI.Gio.Interfaces.ProxyResolver

Methods

toManagedPtr :: ProxyResolver -> ManagedPtr ProxyResolver

TypedObject ProxyResolver Source # 
Instance details

Defined in GI.Gio.Interfaces.ProxyResolver

Methods

glibType :: IO GType

HasParentTypes ProxyResolver Source # 
Instance details

Defined in GI.Gio.Interfaces.ProxyResolver

IsGValue (Maybe ProxyResolver) Source #

Convert ProxyResolver to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gio.Interfaces.ProxyResolver

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe ProxyResolver -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe ProxyResolver)

type ParentTypes ProxyResolver Source # 
Instance details

Defined in GI.Gio.Interfaces.ProxyResolver

type ParentTypes ProxyResolver = '[Object]

class (GObject o, IsDescendantOf ProxyResolver o) => IsProxyResolver o Source #

Type class for types which can be safely cast to ProxyResolver, for instance with toProxyResolver.

Instances

Instances details
(GObject o, IsDescendantOf ProxyResolver o) => IsProxyResolver o Source # 
Instance details

Defined in GI.Gio.Interfaces.ProxyResolver

toProxyResolver :: (MonadIO m, IsProxyResolver o) => o -> m ProxyResolver Source #

Cast to ProxyResolver, for types for which this is known to be safe. For general casts, use castTo.

Methods

getDefault

proxyResolverGetDefault Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m ProxyResolver

Returns: the default ProxyResolver, which will be a dummy object if no proxy resolver is available

Gets the default ProxyResolver for the system.

Since: 2.26

isSupported

proxyResolverIsSupported Source #

Arguments

:: (HasCallStack, MonadIO m, IsProxyResolver a) 
=> a

resolver: a ProxyResolver

-> m Bool

Returns: True if resolver is supported.

Checks if resolver can be used on this system. (This is used internally; proxyResolverGetDefault will only return a proxy resolver that returns True for this method.)

Since: 2.26

lookup

proxyResolverLookup Source #

Arguments

:: (HasCallStack, MonadIO m, IsProxyResolver a, IsCancellable b) 
=> a

resolver: a ProxyResolver

-> Text

uri: a URI representing the destination to connect to

-> Maybe b

cancellable: a Cancellable, or Nothing

-> m [Text]

Returns: A NULL-terminated array of proxy URIs. Must be freed with strfreev. (Can throw GError)

Looks into the system proxy configuration to determine what proxy, if any, to use to connect to uri. The returned proxy URIs are of the form <protocol>://[user[:password]@]host:port or direct://, where <protocol> could be http, rtsp, socks or other proxying protocol.

If you don't know what network protocol is being used on the socket, you should use none as the URI protocol. In this case, the resolver might still return a generic proxy type (such as SOCKS), but would not return protocol-specific proxy types (such as http).

direct:// is used when no proxy is needed. Direct connection should not be attempted unless it is part of the returned array of proxies.

Since: 2.26

lookupAsync

proxyResolverLookupAsync Source #

Arguments

:: (HasCallStack, MonadIO m, IsProxyResolver a, IsCancellable b) 
=> a

resolver: a ProxyResolver

-> Text

uri: a URI representing the destination to connect to

-> Maybe b

cancellable: a Cancellable, or Nothing

-> Maybe AsyncReadyCallback

callback: callback to call after resolution completes

-> m () 

Asynchronous lookup of proxy. See proxyResolverLookup for more details.

Since: 2.26

lookupFinish

proxyResolverLookupFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsProxyResolver a, IsAsyncResult b) 
=> a

resolver: a ProxyResolver

-> b

result: the result passed to your AsyncReadyCallback

-> m [Text]

Returns: A NULL-terminated array of proxy URIs. Must be freed with strfreev. (Can throw GError)

Call this function to obtain the array of proxy URIs when proxyResolverLookupAsync is complete. See proxyResolverLookup for more details.

Since: 2.26