gi-gio-2.0.12: Gio bindings

CopyrightWill Thompson, Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.Gio.Interfaces.Proxy

Contents

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.

Synopsis

Exported types

newtype Proxy Source #

Constructors

Proxy (ManagedPtr Proxy) 

Instances

GObject Proxy Source # 

Methods

gobjectType :: Proxy -> IO GType #

IsObject Proxy Source # 
IsProxy Proxy Source # 
((~) * info (ResolveProxyMethod t Proxy), MethodInfo * info Proxy p) => IsLabel t (Proxy -> p) Source # 

Methods

fromLabel :: Proxy# Symbol t -> Proxy -> p #

((~) * info (ResolveProxyMethod t Proxy), MethodInfo * info Proxy p) => IsLabelProxy t (Proxy -> p) Source # 

Methods

fromLabelProxy :: Proxy Symbol t -> Proxy -> p #

HasAttributeList * Proxy Source # 
type AttributeList Proxy Source # 
type SignalList Proxy Source # 

Methods

connect

data ProxyConnectMethodInfo Source #

Instances

((~) * signature (b -> c -> Maybe d -> m IOStream), MonadIO m, IsProxy a, IsIOStream b, IsProxyAddress c, IsCancellable d) => MethodInfo * ProxyConnectMethodInfo a signature Source # 

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.

Lookup "gio-proxy" extension point for a proxy implementation that supports 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