quic-0.0.0: QUIC
Safe HaskellNone



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


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.


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.

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.


data ResumptionInfo Source #

Information about resumption

getResumptionInfo :: Connection -> IO ResumptionInfo Source #

Getting information about resumption.

isResumptionPossible :: ResumptionInfo -> Bool Source #

Is resumption possible?

is0RTTPossible :: ResumptionInfo -> Bool Source #

Is 0RTT possible?


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.