Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This main module provides APIs for QUIC clients. When a new better network interface is up, migration is done automatically.
Synopsis
- run :: ClientConfig -> (Connection -> IO a) -> IO a
- data ClientConfig
- defaultClientConfig :: ClientConfig
- ccServerName :: ClientConfig -> HostName
- ccPortName :: ClientConfig -> ServiceName
- ccALPN :: ClientConfig -> Version -> IO (Maybe [ByteString])
- ccUse0RTT :: ClientConfig -> Bool
- ccResumption :: ClientConfig -> ResumptionInfo
- ccCiphers :: ClientConfig -> [Cipher]
- ccGroups :: ClientConfig -> [Group]
- ccVersions :: ClientConfig -> [Version]
- ccValidate :: ClientConfig -> Bool
- ccAutoMigration :: ClientConfig -> Bool
- data ResumptionInfo
- getResumptionInfo :: Connection -> IO ResumptionInfo
- isResumptionPossible :: ResumptionInfo -> Bool
- is0RTTPossible :: ResumptionInfo -> Bool
- migrate :: Connection -> IO Bool
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
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
.