README.md revision 646652a6
1[![Linux and MacOS build status](https://ci.appveyor.com/api/projects/status/x790ve5msewmva2b/branch/master?svg=true)](https://ci.appveyor.com/project/litespeedtech/lsquic-linux/branch/master)
2[![Windows build status](https://ci.appveyor.com/api/projects/status/ij4n3vy343pkgm1j/branch/master?svg=true)](https://ci.appveyor.com/project/litespeedtech/lsquic-windows/branch/master)
3[![FreeBSD build status](https://api.cirrus-ci.com/github/litespeedtech/lsquic.svg)](https://cirrus-ci.com/github/litespeedtech/lsquic)
4[![Documentation Status](https://readthedocs.org/projects/lsquic/badge/?version=latest)](https://lsquic.readthedocs.io/en/latest/?badge=latest)
5
6LiteSpeed QUIC (LSQUIC) Library README
7=============================================
8
9Description
10-----------
11
12LiteSpeed QUIC (LSQUIC) Library is an open-source implementation of QUIC
13and HTTP/3 functionality for servers and clients.  Most of the code in this
14distribution is used in our own products: LiteSpeed Web Server, LiteSpeed ADC,
15and OpenLiteSpeed.
16
17Currently supported QUIC versions are v1, Internet-Draft versions 29, and 27;
18and the older "Google" QUIC versions Q043, Q046, an Q050.
19
20Documentation
21-------------
22
23Documentation is available at https://lsquic.readthedocs.io/en/latest/.
24
25In addition, see example programs for API usage and EXAMPLES.txt for
26some compilation and run-time options.
27
28Requirements
29------------
30
31To build LSQUIC, you need CMake, zlib, and BoringSSL.  The example program
32uses libevent to provide the event loop.
33
34Building BoringSSL
35------------------
36
37BoringSSL is not packaged; you have to build it yourself.  The process is
38straightforward.  You will need `go` installed.
39
401. Clone BoringSSL by issuing the following command:
41
42```
43git clone https://boringssl.googlesource.com/boringssl
44cd boringssl
45```
46
47You may need to install pre-requisites like zlib and libevent.
48
492. Use specific BoringSSL version
50
51```
52git checkout a9670a8b476470e6f874fef3554e8059683e1413
53```
54
553. Compile the library
56
57```
58cmake . &&  make
59```
60
61Remember where BoringSSL sources are:
62```
63BORINGSSL=$PWD
64```
65
66If you want to turn on optimizations, do
67
68```
69cmake -DCMAKE_BUILD_TYPE=Release . && make
70```
71
72If you want to build as a library, (necessary to build lsquic itself
73as as shared library) do:
74
75```
76cmake -DBUILD_SHARED_LIBS=1 . && make
77```
78
79Building LSQUIC Library
80-----------------------
81
82LSQUIC's `http_client`, `http_server`, and the tests link BoringSSL
83libraries statically.  Following previous section, you can build LSQUIC
84as follows:
85
861. Get the source code
87
88```
89git clone https://github.com/litespeedtech/lsquic.git
90cd lsquic
91git submodule init
92git submodule update
93```
94
952. Compile the library
96
97Statically:
98
99
100```
101# $BORINGSSL is the top-level BoringSSL directory from the previous step
102cmake -DBORINGSSL_DIR=$BORINGSSL .
103make
104```
105
106As a dynamic library:
107
108```
109cmake -DLSQUIC_SHARED_LIB=1 -DBORINGSSL_DIR=$BORINGSSL .
110make
111```
112
113
1143. Run tests
115
116```
117make test
118```
119
120Building with Docker
121---------
122The library and the example client and server can be built with Docker.
123
124Initialize Git submodules:
125```
126cd lsquic
127git submodule init
128git submodule update
129```
130
131Build the Docker image:
132```
133docker build -t lsquic .
134```
135
136Then you can use the examples from the command line.  For example:
137```
138sudo docker run -it --rm lsquic http_client -s www.google.com  -p / -o version=h3-29
139sudo docker run -p 12345:12345/udp -v /path/to/certs:/mnt/certs -it --rm lsquic http_server -c www.example.com,/mnt/certs/chain,/mnt/certs/key
140```
141
142Platforms
143---------
144
145The library has been tested on the following platforms:
146- Linux
147  - i386
148  - x86_64
149  - ARM (Raspberry Pi 3)
150- FreeBSD
151  - i386
152- MacOS
153  - x86_64
154- iOS
155  - ARM
156- Android
157  - ARM
158- Windows
159  - x86_64
160
161Get Involved
162------------
163
164Do not hesitate to report bugs back to us.  Even better, send us fixes
165and improvements!
166
167Have fun,
168
169LiteSpeed QUIC Team.
170
171Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc
172