gi-gio
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gio.Interfaces.Proxy

Description

A GProxy 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

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

HasAttributeList Proxy Source # 
Instance details

Defined in GI.Gio.Interfaces.Proxy

(info ~ ResolveProxyMethod t Proxy, OverloadedMethod info Proxy p, HasField t Proxy p) => HasField (t :: Symbol) Proxy (p :: Type) Source # 
Instance details

Defined in GI.Gio.Interfaces.Proxy

Methods

getField :: Proxy -> p #

(info ~ ResolveProxyMethod t Proxy, OverloadedMethodInfo info Proxy) => IsLabel t (MethodProxy info Proxy) Source # 
Instance details

Defined in GI.Gio.Interfaces.Proxy

Methods

fromLabel :: MethodProxy info Proxy #

(info ~ ResolveProxyMethod t Proxy, OverloadedMethod info Proxy p) => IsLabel t (Proxy -> p) Source # 
Instance details

Defined in GI.Gio.Interfaces.Proxy

Methods

fromLabel :: Proxy -> p #

IsGValue (Maybe Proxy) Source #

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

Instance details

Defined in GI.Gio.Interfaces.Proxy

type AttributeList Proxy Source # 
Instance details

Defined in GI.Gio.Interfaces.Proxy

type ParentTypes Proxy Source # 
Instance details

Defined in GI.Gio.Interfaces.Proxy

type SignalList Proxy Source # 
Instance details

Defined in GI.Gio.Interfaces.Proxy

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

type family ResolveProxyMethod (t :: Symbol) o where ... Source #

Equations

ResolveProxyMethod "bindProperty" o = ObjectBindPropertyMethodInfo 
ResolveProxyMethod "bindPropertyFull" o = ObjectBindPropertyFullMethodInfo 
ResolveProxyMethod "connect" o = ProxyConnectMethodInfo 
ResolveProxyMethod "connectAsync" o = ProxyConnectAsyncMethodInfo 
ResolveProxyMethod "connectFinish" o = ProxyConnectFinishMethodInfo 
ResolveProxyMethod "forceFloating" o = ObjectForceFloatingMethodInfo 
ResolveProxyMethod "freezeNotify" o = ObjectFreezeNotifyMethodInfo 
ResolveProxyMethod "getv" o = ObjectGetvMethodInfo 
ResolveProxyMethod "isFloating" o = ObjectIsFloatingMethodInfo 
ResolveProxyMethod "notify" o = ObjectNotifyMethodInfo 
ResolveProxyMethod "notifyByPspec" o = ObjectNotifyByPspecMethodInfo 
ResolveProxyMethod "ref" o = ObjectRefMethodInfo 
ResolveProxyMethod "refSink" o = ObjectRefSinkMethodInfo 
ResolveProxyMethod "runDispose" o = ObjectRunDisposeMethodInfo 
ResolveProxyMethod "stealData" o = ObjectStealDataMethodInfo 
ResolveProxyMethod "stealQdata" o = ObjectStealQdataMethodInfo 
ResolveProxyMethod "supportsHostname" o = ProxySupportsHostnameMethodInfo 
ResolveProxyMethod "thawNotify" o = ObjectThawNotifyMethodInfo 
ResolveProxyMethod "unref" o = ObjectUnrefMethodInfo 
ResolveProxyMethod "watchClosure" o = ObjectWatchClosureMethodInfo 
ResolveProxyMethod "getData" o = ObjectGetDataMethodInfo 
ResolveProxyMethod "getProperty" o = ObjectGetPropertyMethodInfo 
ResolveProxyMethod "getQdata" o = ObjectGetQdataMethodInfo 
ResolveProxyMethod "setData" o = ObjectSetDataMethodInfo 
ResolveProxyMethod "setDataFull" o = ObjectSetDataFullMethodInfo 
ResolveProxyMethod "setProperty" o = ObjectSetPropertyMethodInfo 
ResolveProxyMethod l o = MethodResolutionFailed l o :: Type 

connect

data ProxyConnectMethodInfo Source #

Instances

Instances details
(signature ~ (b -> c -> Maybe d -> m IOStream), MonadIO m, IsProxy a, IsIOStream b, IsProxyAddress c, IsCancellable d) => OverloadedMethod ProxyConnectMethodInfo a signature Source # 
Instance details

Defined in GI.Gio.Interfaces.Proxy

Methods

overloadedMethod :: a -> signature #

OverloadedMethodInfo ProxyConnectMethodInfo (a :: Type) Source # 
Instance details

Defined in GI.Gio.Interfaces.Proxy

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

data ProxyConnectAsyncMethodInfo Source #

Instances

Instances details
(signature ~ (b -> c -> Maybe d -> Maybe AsyncReadyCallback -> m ()), MonadIO m, IsProxy a, IsIOStream b, IsProxyAddress c, IsCancellable d) => OverloadedMethod ProxyConnectAsyncMethodInfo a signature Source # 
Instance details

Defined in GI.Gio.Interfaces.Proxy

Methods

overloadedMethod :: a -> signature #

OverloadedMethodInfo ProxyConnectAsyncMethodInfo (a :: Type) Source # 
Instance details

Defined in GI.Gio.Interfaces.Proxy

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

data ProxyConnectFinishMethodInfo Source #

Instances

Instances details
(signature ~ (b -> m IOStream), MonadIO m, IsProxy a, IsAsyncResult b) => OverloadedMethod ProxyConnectFinishMethodInfo a signature Source # 
Instance details

Defined in GI.Gio.Interfaces.Proxy

Methods

overloadedMethod :: a -> signature #

OverloadedMethodInfo ProxyConnectFinishMethodInfo (a :: Type) Source # 
Instance details

Defined in GI.Gio.Interfaces.Proxy

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 (Maybe 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

data ProxySupportsHostnameMethodInfo Source #

Instances

Instances details
(signature ~ m Bool, MonadIO m, IsProxy a) => OverloadedMethod ProxySupportsHostnameMethodInfo a signature Source # 
Instance details

Defined in GI.Gio.Interfaces.Proxy

Methods

overloadedMethod :: a -> signature #

OverloadedMethodInfo ProxySupportsHostnameMethodInfo (a :: Type) Source # 
Instance details

Defined in GI.Gio.Interfaces.Proxy

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