quic-0.1.20: QUIC
Safe HaskellSafe-Inferred
LanguageHaskell2010

Network.QUIC.Client

Description

This main module provides APIs for QUIC clients. When a new better network interface is up, migration is done automatically.

Synopsis

Running a QUIC client

run :: ClientConfig -> (Connection -> IO a) -> IO a Source #

Running a QUIC client. A UDP socket is created according to ccServerName and ccPortName.

If ccAutoMigration is True, a unconnected socket is made. Otherwise, a connected socket is made. Use the migrate API for the connected socket.

Configration

data ClientConfig Source #

Client configuration.

defaultClientConfig :: ClientConfig Source #

The default value for client configuration.

ccServerName :: ClientConfig -> HostName Source #

Used to create a socket and SNI for TLS.

ccPortName :: ClientConfig -> ServiceName Source #

Used to create a socket.

ccALPN :: ClientConfig -> Version -> IO (Maybe [ByteString]) Source #

An ALPN provider.

ccUse0RTT :: ClientConfig -> Bool Source #

Use 0-RTT on the 2nd connection if possible. client original

ccResumption :: ClientConfig -> ResumptionInfo Source #

Use resumption on the 2nd connection if possible.

ccCiphers :: ClientConfig -> [Cipher] Source #

Cipher candidates defined in TLS 1.3.

ccGroups :: ClientConfig -> [Group] Source #

Key exchange group candidates defined in TLS 1.3.

ccVersions :: ClientConfig -> [Version] Source #

Compatible versions with ccVersion in the preferred order.

ccValidate :: ClientConfig -> Bool Source #

Authenticating a server based on its certificate.

ccAutoMigration :: ClientConfig -> Bool Source #

If True, use a unconnected socket for auto migration. Otherwise, use a connected socket.

Resumption

data ResumptionInfo Source #

Information about resumption

Instances

Instances details
Generic ResumptionInfo Source # 
Instance details

Defined in Network.QUIC.Types.Resumption

Associated Types

type Rep ResumptionInfo :: Type -> Type #

Show ResumptionInfo Source # 
Instance details

Defined in Network.QUIC.Types.Resumption

Eq ResumptionInfo Source # 
Instance details

Defined in Network.QUIC.Types.Resumption

Serialise ResumptionInfo Source # 
Instance details

Defined in Network.QUIC.Types.Resumption

type Rep ResumptionInfo Source # 
Instance details

Defined in Network.QUIC.Types.Resumption

type Rep ResumptionInfo = D1 ('MetaData "ResumptionInfo" "Network.QUIC.Types.Resumption" "quic-0.1.20-4xBoOzsr86T1PD98iEWMzj" 'False) (C1 ('MetaCons "ResumptionInfo" 'PrefixI 'True) ((S1 ('MetaSel ('Just "resumptionVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Version) :*: S1 ('MetaSel ('Just "resumptionSession") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (SessionID, SessionData)))) :*: (S1 ('MetaSel ('Just "resumptionToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Token) :*: S1 ('MetaSel ('Just "resumptionRetry") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool))))

getResumptionInfo :: Connection -> IO ResumptionInfo Source #

Getting information about resumption.

isResumptionPossible :: ResumptionInfo -> Bool Source #

Is resumption possible?

is0RTTPossible :: ResumptionInfo -> Bool Source #

Is 0RTT possible?

Migration

migrate :: Connection -> IO Bool Source #

Creating a new socket and execute a path validation with a new connection ID. Typically, this is used for migration in the case where ccAutoMigration is False. But this can also be used even when the value is True.