| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Simplex.Messaging.Transport.Client
Synopsis
- runTransportClient :: Transport c => TransportClientConfig -> Maybe SocksCredentials -> TransportHost -> ServiceName -> Maybe KeyHash -> (c 'TClient -> IO a) -> IO a
- runTLSTransportClient :: Transport c => Supported -> Maybe CertificateStore -> TransportClientConfig -> Maybe SocksCredentials -> TransportHost -> ServiceName -> Maybe KeyHash -> (c 'TClient -> IO a) -> IO a
- smpClientHandshake :: forall c. Transport c => c 'TClient -> Maybe KeyPairX25519 -> KeyHash -> VersionRangeSMP -> Bool -> Maybe (ServiceCredentials, KeyPairEd25519) -> ExceptT TransportError IO (THandleSMP c 'TClient)
- defaultSMPPort :: PortNumber
- defaultTcpConnectTimeout :: Int
- defaultTransportClientConfig :: TransportClientConfig
- defaultSocksProxyWithAuth :: SocksProxyWithAuth
- defaultSocksProxy :: SocksProxy
- defaultSocksHost :: (Word8, Word8, Word8, Word8)
- data TransportClientConfig = TransportClientConfig {
- socksProxy :: Maybe SocksProxy
- tcpConnectTimeout :: Int
- tcpKeepAlive :: Maybe KeepAliveOpts
- logTLSErrors :: Bool
- clientCredentials :: Maybe Credential
- clientALPN :: Maybe [ALPN]
- useSNI :: Bool
- newtype SocksProxy = SocksProxy SockAddr
- data SocksProxyWithAuth = SocksProxyWithAuth SocksAuth SocksProxy
- data SocksAuth
- data TransportHost
- = THIPv4 (Word8, Word8, Word8, Word8)
- | THIPv6 (Word32, Word32, Word32, Word32)
- | THOnionHost ByteString
- | THDomainName HostName
- newtype TransportHosts = TransportHosts {
- thList :: NonEmpty TransportHost
- newtype TransportHosts_ = TransportHosts_ {
- thList_ :: [TransportHost]
- validateCertificateChain :: KeyHash -> HostName -> ByteString -> CertificateChain -> IO [FailedReason]
Documentation
runTransportClient :: Transport c => TransportClientConfig -> Maybe SocksCredentials -> TransportHost -> ServiceName -> Maybe KeyHash -> (c 'TClient -> IO a) -> IO a Source #
Connect to passed TCP host:port and pass handle to the client.
runTLSTransportClient :: Transport c => Supported -> Maybe CertificateStore -> TransportClientConfig -> Maybe SocksCredentials -> TransportHost -> ServiceName -> Maybe KeyHash -> (c 'TClient -> IO a) -> IO a Source #
smpClientHandshake :: forall c. Transport c => c 'TClient -> Maybe KeyPairX25519 -> KeyHash -> VersionRangeSMP -> Bool -> Maybe (ServiceCredentials, KeyPairEd25519) -> ExceptT TransportError IO (THandleSMP c 'TClient) Source #
Client SMP transport handshake.
See https://github.com/simplex-chat/simplexmq/blob/master/protocol/simplex-messaging.md#appendix-a
defaultSMPPort :: PortNumber Source #
defaultTcpConnectTimeout :: Int Source #
defaultSocksHost :: (Word8, Word8, Word8, Word8) Source #
data TransportClientConfig Source #
Constructors
| TransportClientConfig | |
Fields
| |
Instances
| Show TransportClientConfig Source # | |
Defined in Simplex.Messaging.Transport.Client Methods showsPrec :: Int -> TransportClientConfig -> ShowS show :: TransportClientConfig -> String showList :: [TransportClientConfig] -> ShowS | |
| Eq TransportClientConfig Source # | |
Defined in Simplex.Messaging.Transport.Client Methods (==) :: TransportClientConfig -> TransportClientConfig -> Bool (/=) :: TransportClientConfig -> TransportClientConfig -> Bool | |
newtype SocksProxy Source #
Constructors
| SocksProxy SockAddr |
Instances
| Show SocksProxy Source # | |
Defined in Simplex.Messaging.Transport.Client Methods showsPrec :: Int -> SocksProxy -> ShowS show :: SocksProxy -> String showList :: [SocksProxy] -> ShowS | |
| Eq SocksProxy Source # | |
Defined in Simplex.Messaging.Transport.Client | |
| StrEncoding SocksProxy Source # | |
Defined in Simplex.Messaging.Transport.Client Methods strEncode :: SocksProxy -> ByteString Source # strDecode :: ByteString -> Either String SocksProxy Source # strP :: Parser SocksProxy Source # | |
data SocksProxyWithAuth Source #
Constructors
| SocksProxyWithAuth SocksAuth SocksProxy |
Instances
Constructors
| SocksAuthUsername | |
| SocksAuthNull | |
| SocksIsolateByAuth | |
data TransportHost Source #
Constructors
| THIPv4 (Word8, Word8, Word8, Word8) | |
| THIPv6 (Word32, Word32, Word32, Word32) | |
| THOnionHost ByteString | |
| THDomainName HostName |
Instances
newtype TransportHosts Source #
Constructors
| TransportHosts | |
Fields
| |
Instances
| StrEncoding TransportHosts Source # | |
Defined in Simplex.Messaging.Transport.Client Methods strEncode :: TransportHosts -> ByteString Source # strDecode :: ByteString -> Either String TransportHosts Source # strP :: Parser TransportHosts Source # | |
newtype TransportHosts_ Source #
Constructors
| TransportHosts_ | |
Fields
| |
Instances
| StrEncoding TransportHosts_ Source # | |
Defined in Simplex.Messaging.Transport.Client Methods strEncode :: TransportHosts_ -> ByteString Source # strDecode :: ByteString -> Either String TransportHosts_ Source # strP :: Parser TransportHosts_ Source # | |
validateCertificateChain :: KeyHash -> HostName -> ByteString -> CertificateChain -> IO [FailedReason] Source #