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

GI.Gio.Interfaces.Proxy

Description

A Proxy handles connecting to a remote host via a given type of proxy server. It is implemented by the 'gio-proxy' extension point. The extensions are named after their proxy protocol name. As an example, a SOCKS5 proxy implementation can be retrieved with the name 'socks5' using the function iOExtensionPointGetExtensionByName.

Since: 2.26

Synopsis

Exported types

newtype Proxy Source #

Memory-managed wrapper type.

Constructors

Proxy (ManagedPtr Proxy) 

Instances

Instances details
Eq Proxy Source # 
Instance details

Defined in GI.Gio.Interfaces.Proxy

Methods

(==) :: Proxy -> Proxy -> Bool #

(/=) :: Proxy -> Proxy -> Bool #

GObject Proxy Source # 
Instance details

Defined in GI.Gio.Interfaces.Proxy

ManagedPtrNewtype Proxy Source # 
Instance details

Defined in GI.Gio.Interfaces.Proxy

Methods

toManagedPtr :: Proxy -> ManagedPtr Proxy

TypedObject Proxy Source # 
Instance details

Defined in GI.Gio.Interfaces.Proxy

Methods

glibType :: IO GType

HasParentTypes Proxy Source # 
Instance details

Defined in GI.Gio.Interfaces.Proxy

IsGValue (Maybe Proxy) Source #

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

Instance details

Defined in GI.Gio.Interfaces.Proxy

Methods

gvalueGType_ :: IO GType

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

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

type ParentTypes Proxy Source # 
Instance details

Defined in GI.Gio.Interfaces.Proxy

type ParentTypes Proxy = '[Object]

class (GObject o, IsDescendantOf Proxy o) => IsProxy o Source #

Type class for types which can be safely cast to Proxy, for instance with toProxy.

Instances

Instances details
(GObject o, IsDescendantOf Proxy o) => IsProxy o Source # 
Instance details

Defined in GI.Gio.Interfaces.Proxy

toProxy :: (MonadIO m, IsProxy o) => o -> m Proxy Source #

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

Methods

connect

proxyConnect Source #

Arguments

:: (HasCallStack, MonadIO m, IsProxy a, IsIOStream b, IsProxyAddress c, IsCancellable d) 
=> a

proxy: a Proxy

-> b

connection: a IOStream

-> c

proxyAddress: a ProxyAddress

-> Maybe d

cancellable: a Cancellable

-> m IOStream

Returns: a IOStream that will replace connection. This might be the same as connection, in which case a reference will be added. (Can throw GError)

Given connection to communicate with a proxy (eg, a SocketConnection that is connected to the proxy server), this does the necessary handshake to connect to proxyAddress, and if required, wraps the IOStream to handle proxy payload.

Since: 2.26

connectAsync

proxyConnectAsync Source #

Arguments

:: (HasCallStack, MonadIO m, IsProxy a, IsIOStream b, IsProxyAddress c, IsCancellable d) 
=> a

proxy: a Proxy

-> b

connection: a IOStream

-> c

proxyAddress: a ProxyAddress

-> Maybe d

cancellable: a Cancellable

-> Maybe AsyncReadyCallback

callback: a AsyncReadyCallback

-> m () 

Asynchronous version of proxyConnect.

Since: 2.26

connectFinish

proxyConnectFinish Source #

Arguments

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

proxy: a Proxy

-> b

result: a AsyncResult

-> m IOStream

Returns: a IOStream. (Can throw GError)

See proxyConnect.

Since: 2.26

getDefaultForProtocol

proxyGetDefaultForProtocol Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

protocol: the proxy protocol name (e.g. http, socks, etc)

-> m Proxy

Returns: return a Proxy or NULL if protocol is not supported.

Find the gio-proxy extension point for a proxy implementation that supports the specified protocol.

Since: 2.26

supportsHostname

proxySupportsHostname Source #

Arguments

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

proxy: a Proxy

-> m Bool

Returns: True if hostname resolution is supported.

Some proxy protocols expect to be passed a hostname, which they will resolve to an IP address themselves. Others, like SOCKS4, do not allow this. This function will return False if proxy is implementing such a protocol. When False is returned, the caller should resolve the destination hostname first, and then pass a ProxyAddress containing the stringified IP address to proxyConnect or proxyConnectAsync.

Since: 2.26