README.md revision f87fb49c
1[![Build Status](https://travis-ci.org/litespeedtech/lsquic.svg?branch=master)](https://travis-ci.org/litespeedtech/lsquic)
2[![Build Status](https://api.cirrus-ci.com/github/litespeedtech/lsquic.svg)](https://cirrus-ci.com/github/litespeedtech/lsquic)
3[![Build status](https://ci.appveyor.com/api/projects/status/kei9649t9leoqicr?svg=true)](https://ci.appveyor.com/project/litespeedtech/lsquic)
4
5LiteSpeed QUIC (LSQUIC) Library README
6=============================================
7
8Description
9-----------
10
11LiteSpeed QUIC (LSQUIC) Library is an open-source implementation of QUIC
12and HTTP/3 functionality for servers and clients.  Most of the code in this
13distribution is used in our own products: LiteSpeed Web Server, LiteSpeed ADC,
14and OpenLiteSpeed.  We think it is free of major problems.  Nevertheless, do
15not hesitate to report bugs back to us.  Even better, send us fixes and
16improvements!
17
18Currently supported QUIC versions are Q039, Q043, Q046, and ID-23.  Support
19for newer versions will be added soon after they are released.
20
21Documentation
22-------------
23
24The documentation for this module is admittedly sparse.  The API is
25documented in include/lsquic.h.  If you have doxygen, you can run
26`doxygen dox.cfg` or `make docs`.  The example program is
27test/http_client.c: a bare-bones, but working, QUIC client.  Have a look
28in EXAMPLES.txt to see how it can be used.
29
30Requirements
31------------
32
33To build LSQUIC, you need CMake, zlib, and BoringSSL.  The example program
34uses libevent to provide the event loop.
35
36Building BoringSSL
37------------------
38
39BoringSSL is not packaged; you have to build it yourself.  The process is
40straightforward.  You will need `go` installed.
41
421. Clone BoringSSL by issuing the following command:
43
44```
45git clone https://boringssl.googlesource.com/boringssl
46cd boringssl
47```
48
49You may need to install pre-requisites like zlib and libevent.
50
512. Use specific BoringSSL version
52
53```
54git checkout 32e59d2d3264e4e104b355ef73663b8b79ac4093
55```
56
573. Patch the library
58
59This patch is required for IETF QUIC support.
60
61```
62patch -p1 -i ../patches/boringssl-meds.patch
63```
64
654. Compile the library
66
67```
68cmake . &&  make
69```
70
71Remember where BoringSSL sources are:
72```
73BORINGSSL=$PWD
74```
75
76If you want to turn on optimizations, do
77
78```
79cmake -DCMAKE_BUILD_TYPE=Release . && make
80```
81
82Building LSQUIC Library
83-----------------------
84
85LSQUIC's `http_client`, `http_server`, and the tests link BoringSSL
86libraries statically.  Following previous section, you can build LSQUIC
87as follows:
88
891. Get the source code
90
91```
92git clone https://github.com/litespeedtech/lsquic.git
93cd lsquic
94git submodule init
95git submodule update
96```
97
982. Compile the library
99
100
101```
102# $BORINGSSL is the top-level BoringSSL directory from the previous step
103cmake -DBORINGSSL_DIR=$BORINGSSL .
104make
105```
106
1073. Run tests
108
109```
110make test
111```
112
113Building with Docker
114---------
115The library and the example client and server can be built with Docker.
116
117Initialize Git submodules:
118```
119cd lsquic
120git submodule init
121git submodule update
122```
123
124Build the Docker image:
125```
126docker build -t lsquic .
127```
128
129Then you can use the examples from the command line.  For example:
130```
131sudo docker run -it --rm lsquic http_client -s www.google.com  -p / -o version=Q046
132sudo 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
133```
134
135Platforms
136---------
137
138The library has been tested on the following platforms:
139- Linux
140  - i386
141  - x86_64
142  - ARM (Raspberry Pi 3)
143- FreeBSD
144  - i386
145- MacOS
146  - x86_64
147- Windows (this needs updating for the server part, now broken)
148  - x86_64
149
150Have fun,
151
152LiteSpeed QUIC Team.
153
154Copyright (c) 2017 - 2019 LiteSpeed Technologies Inc
155