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.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
- newtype Proxy = Proxy (ManagedPtr Proxy)
- class (GObject o, IsDescendantOf Proxy o) => IsProxy o
- toProxy :: (MonadIO m, IsProxy o) => o -> m Proxy
- type family ResolveProxyMethod (t :: Symbol) o where ...
- data ProxyConnectMethodInfo
- proxyConnect :: (HasCallStack, MonadIO m, IsProxy a, IsIOStream b, IsProxyAddress c, IsCancellable d) => a -> b -> c -> Maybe d -> m IOStream
- data ProxyConnectAsyncMethodInfo
- proxyConnectAsync :: (HasCallStack, MonadIO m, IsProxy a, IsIOStream b, IsProxyAddress c, IsCancellable d) => a -> b -> c -> Maybe d -> Maybe AsyncReadyCallback -> m ()
- data ProxyConnectFinishMethodInfo
- proxyConnectFinish :: (HasCallStack, MonadIO m, IsProxy a, IsAsyncResult b) => a -> b -> m IOStream
- proxyGetDefaultForProtocol :: (HasCallStack, MonadIO m) => Text -> m (Maybe Proxy)
- data ProxySupportsHostnameMethodInfo
- proxySupportsHostname :: (HasCallStack, MonadIO m, IsProxy a) => a -> m Bool
Exported types
Memory-managed wrapper type.
Constructors
Proxy (ManagedPtr Proxy) |
Instances
class (GObject o, IsDescendantOf Proxy o) => IsProxy o Source #
Instances
(GObject o, IsDescendantOf Proxy o) => IsProxy o Source # | |
Defined in GI.Gio.Interfaces.Proxy |
Methods
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, connect, connectAsync, connectFinish, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, supportsHostname, thawNotify, unref, watchClosure.
Getters
getData, getProperty, getQdata.
Setters
type family ResolveProxyMethod (t :: Symbol) o where ... Source #
Equations
connect
data ProxyConnectMethodInfo Source #
Instances
(signature ~ (b -> c -> Maybe d -> m IOStream), MonadIO m, IsProxy a, IsIOStream b, IsProxyAddress c, IsCancellable d) => OverloadedMethod ProxyConnectMethodInfo a signature Source # | |
Defined in GI.Gio.Interfaces.Proxy Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo ProxyConnectMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Interfaces.Proxy Methods |
Arguments
:: (HasCallStack, MonadIO m, IsProxy a, IsIOStream b, IsProxyAddress c, IsCancellable d) | |
=> a |
|
-> b |
|
-> c |
|
-> Maybe d |
|
-> m IOStream | Returns: a |
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
(signature ~ (b -> c -> Maybe d -> Maybe AsyncReadyCallback -> m ()), MonadIO m, IsProxy a, IsIOStream b, IsProxyAddress c, IsCancellable d) => OverloadedMethod ProxyConnectAsyncMethodInfo a signature Source # | |
Defined in GI.Gio.Interfaces.Proxy Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo ProxyConnectAsyncMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Interfaces.Proxy Methods |
Arguments
:: (HasCallStack, MonadIO m, IsProxy a, IsIOStream b, IsProxyAddress c, IsCancellable d) | |
=> a |
|
-> b |
|
-> c |
|
-> Maybe d |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Asynchronous version of proxyConnect
.
Since: 2.26
connectFinish
data ProxyConnectFinishMethodInfo Source #
Instances
(signature ~ (b -> m IOStream), MonadIO m, IsProxy a, IsAsyncResult b) => OverloadedMethod ProxyConnectFinishMethodInfo a signature Source # | |
Defined in GI.Gio.Interfaces.Proxy Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo ProxyConnectFinishMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Interfaces.Proxy Methods |
Arguments
:: (HasCallStack, MonadIO m, IsProxy a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m IOStream |
See proxyConnect
.
Since: 2.26
getDefaultForProtocol
proxyGetDefaultForProtocol Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m (Maybe Proxy) | Returns: return a |
Find the gio-proxy
extension point for a proxy implementation that supports
the specified protocol.
Since: 2.26
supportsHostname
data ProxySupportsHostnameMethodInfo Source #
Instances
(signature ~ m Bool, MonadIO m, IsProxy a) => OverloadedMethod ProxySupportsHostnameMethodInfo a signature Source # | |
Defined in GI.Gio.Interfaces.Proxy Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo ProxySupportsHostnameMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Interfaces.Proxy Methods |
proxySupportsHostname Source #
Arguments
:: (HasCallStack, MonadIO m, IsProxy a) | |
=> a |
|
-> m Bool | Returns: |
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