Skip to content

Commit 8ea0b00

Browse files
committed
Documentation and packaging improvements for network-transport-quic
1 parent 71ae57f commit 8ea0b00

File tree

3 files changed

+56
-3
lines changed

3 files changed

+56
-3
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11

2+
2026-01-01 Laurent P. René de Cotret <laurent.decotret@outlook.com> 0.1.1
3+
4+
* Documentation and packaging improvements.
5+
26
2026-01-01 Laurent P. René de Cotret <laurent.decotret@outlook.com> 0.1.0
37

48
* Initial release.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# `network-transport-quic`
2+
3+
This package provides an implementation of the `network-transport` interface, where networking is done via the QUIC protocol. The primary use-case for this package is as a Cloud Haskell backend.
4+
5+
QUIC has many advantages over TCP, including:
6+
7+
* No head-of-line blocking. Independent streams mean packet loss on one stream doesn't stall others;
8+
* Connection migration. Connections survive IP address changes, which is important when a device switches from e.g. WIFI to 5G;
9+
* Built-in encryption via TLS 1.3;
10+
11+
In benchmarks, `network-transport-quic` performs better than `network-transport-tcp` in dense network topologies. For example, if every `EndPoint` in your network connects to every other `EndPoint`, you might benefit greatly from switching to `network-transport-quic`!
12+
13+
## Usage example
14+
15+
Provided you have a TLS 1.3 certificate, you can create a `Transport` like so:
16+
17+
```haskell
18+
import Data.List.NonEmpty qualified as NonEmpty
19+
import Network.Transport.QUIC (QUICTransportConfig(..), createTransport, credentialLoadX509)
20+
21+
main = do
22+
let certificate = "path/to/cert.crt"
23+
key = "path/to/cert.key"
24+
25+
creds <- credentialLoadX509 certificate key
26+
case creds of
27+
Left error_message -> error error_message
28+
Right credential -> do
29+
let config = QUICTransportConfig
30+
{ hostName = "my.hostname.com" -- or some IP address
31+
, serviceName = "https" -- alternatively, some port number
32+
, credentials = NonEmpty.singleton credential
33+
, validateCredentials = True -- should be 'False' for self-signed certificate
34+
}
35+
transport <- createTransport config
36+
...
37+
```
38+
39+
There are tools online to help create self-signed TLS 1.3 certificates.

packages/network-transport-quic/network-transport-quic.cabal

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 3.0
22
Name: network-transport-quic
3-
Version: 0.1.0
3+
Version: 0.1.1
44
build-Type: Simple
55
License: BSD-3-Clause
66
License-file: LICENSE
@@ -11,10 +11,20 @@ Stability: experimental
1111
Homepage: https://haskell-distributed.github.io
1212
Bug-Reports: https://github.com/haskell-distributed/distributed-process/issues
1313
Synopsis: Networking layer for Cloud Haskell based on QUIC
14-
Description: Networking layer for Cloud Haskell based on QUIC
14+
Description:
15+
Networking layer for Cloud Haskell based on QUIC.
16+
17+
The QUIC protocol has several advantages over TCP, including built-in encryption via TLS 1.3,
18+
support for connection migration (e.g. when transitioning from WIFI to 5G), and stream multiplexing which
19+
eliminates head-of-line blocking.
20+
21+
In dense network topologies, using ["Network.Transport.QUIC"] may improve performance by a factor of 2 over
22+
other transport implementations.
1523
tested-with: GHC==8.10.7 GHC==9.0.2 GHC==9.2.8 GHC==9.4.8 GHC==9.6.7 GHC==9.8.4 GHC==9.10.3 GHC==9.12.2
1624
Category: Network
17-
extra-doc-files: CHANGELOG.md
25+
extra-doc-files:
26+
README.md
27+
CHANGELOG.md
1828
extra-source-files:
1929
test/credentials/cert.crt
2030
test/credentials/cert.key

0 commit comments

Comments
 (0)