| Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria |
| Safe Haskell | None |
| Language | Haskell2010 |
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
- newtype Proxy = Proxy (ManagedPtr Proxy)
- noProxy :: Maybe Proxy
- class (GObject o, IsDescendantOf Proxy o) => IsProxy o
- toProxy :: (MonadIO m, IsProxy o) => o -> m Proxy
- proxyConnect :: (HasCallStack, MonadIO m, IsProxy a, IsIOStream b, IsProxyAddress c, IsCancellable d) => a -> b -> c -> Maybe d -> m IOStream
- proxyConnectAsync :: (HasCallStack, MonadIO m, IsProxy a, IsIOStream b, IsProxyAddress c, IsCancellable d) => a -> b -> c -> Maybe d -> Maybe AsyncReadyCallback -> m ()
- proxyConnectFinish :: (HasCallStack, MonadIO m, IsProxy a, IsAsyncResult b) => a -> b -> m IOStream
- proxyGetDefaultForProtocol :: (HasCallStack, MonadIO m) => Text -> m Proxy
- proxySupportsHostname :: (HasCallStack, MonadIO m, IsProxy a) => a -> m Bool
Exported types
Memory-managed wrapper type.
Constructors
| Proxy (ManagedPtr Proxy) |
Instances
| Eq Proxy Source # | |
| GObject Proxy Source # | |
Defined in GI.Gio.Interfaces.Proxy Methods gobjectType :: IO GType # | |
| IsGValue Proxy Source # | Convert |
| HasParentTypes Proxy Source # | |
Defined in GI.Gio.Interfaces.Proxy | |
| type ParentTypes Proxy Source # | |
Defined in GI.Gio.Interfaces.Proxy | |
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
Overloaded methods
connect
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
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
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 Proxy | Returns: return a |
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 |
|
| -> 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