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 |
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)
- 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.
Instances
Eq Proxy Source # | |
IsGValue Proxy Source # | Convert |
ManagedPtrNewtype Proxy Source # | |
Defined in GI.Gio.Interfaces.Proxy toManagedPtr :: Proxy -> ManagedPtr Proxy # | |
TypedObject Proxy Source # | |
Defined in GI.Gio.Interfaces.Proxy | |
GObject Proxy Source # | |
Defined in GI.Gio.Interfaces.Proxy | |
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
:: (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
:: (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
:: (HasCallStack, MonadIO m, IsProxy a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m IOStream |
See proxyConnect
.
Since: 2.26
getDefaultForProtocol
proxyGetDefaultForProtocol Source #
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m Proxy | Returns: return a |
Find the gio-proxy
extension point for a proxy implementation that supports
the specified protocol.
Since: 2.26
supportsHostname
proxySupportsHostname Source #
:: (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