README.md revision 96214405
196214405SLiteSpeed Tech[![Build Status](https://travis-ci.com/litespeedtech/lsquic.svg?branch=master)](https://travis-ci.com/litespeedtech/lsquic)
25392f7a3SLiteSpeed Tech[![Build Status](https://api.cirrus-ci.com/github/litespeedtech/lsquic.svg)](https://cirrus-ci.com/github/litespeedtech/lsquic)
3f50b9148SDmitri Tikhonov[![Build status](https://ci.appveyor.com/api/projects/status/ij4n3vy343pkgm1j?svg=true)](https://ci.appveyor.com/project/litespeedtech/lsquic)
41fc8f998SDmitri Tikhonov
55392f7a3SLiteSpeed TechLiteSpeed QUIC (LSQUIC) Library README
650aadb33SDmitri Tikhonov=============================================
750aadb33SDmitri Tikhonov
850aadb33SDmitri TikhonovDescription
950aadb33SDmitri Tikhonov-----------
1050aadb33SDmitri Tikhonov
115392f7a3SLiteSpeed TechLiteSpeed QUIC (LSQUIC) Library is an open-source implementation of QUIC
12f87fb49cSDmitri Tikhonovand HTTP/3 functionality for servers and clients.  Most of the code in this
13f87fb49cSDmitri Tikhonovdistribution is used in our own products: LiteSpeed Web Server, LiteSpeed ADC,
14758aff32SDmitri Tikhonovand OpenLiteSpeed.
1550aadb33SDmitri Tikhonov
16b1a7c3f9SDmitri TikhonovCurrently supported QUIC versions are Q043, Q046, Q050, ID-27, ID-28, ID-29,
174429f8eaSDmitri Tikhonovand ID-32.  Support for newer versions is added soon after they are released.
1850aadb33SDmitri Tikhonov
1950aadb33SDmitri TikhonovDocumentation
2050aadb33SDmitri Tikhonov-------------
2150aadb33SDmitri Tikhonov
22a5fa05f9SDmitri TikhonovDocumentation is available at https://lsquic.readthedocs.io/en/latest/.
23a5fa05f9SDmitri Tikhonov
24a5fa05f9SDmitri TikhonovIn addition, see example programs for API usage and EXAMPLES.txt for
25a5fa05f9SDmitri Tikhonovsome compilation and run-time options.
2650aadb33SDmitri Tikhonov
27e0197994SDmitri TikhonovRequirements
28e0197994SDmitri Tikhonov------------
2950aadb33SDmitri Tikhonov
30e0197994SDmitri TikhonovTo build LSQUIC, you need CMake, zlib, and BoringSSL.  The example program
31e0197994SDmitri Tikhonovuses libevent to provide the event loop.
3250aadb33SDmitri Tikhonov
33e0197994SDmitri TikhonovBuilding BoringSSL
34e0197994SDmitri Tikhonov------------------
35e0197994SDmitri Tikhonov
36e0197994SDmitri TikhonovBoringSSL is not packaged; you have to build it yourself.  The process is
37e0197994SDmitri Tikhonovstraightforward.  You will need `go` installed.
38e0197994SDmitri Tikhonov
39e0197994SDmitri Tikhonov1. Clone BoringSSL by issuing the following command:
40e0197994SDmitri Tikhonov
41e0197994SDmitri Tikhonov```
42e0197994SDmitri Tikhonovgit clone https://boringssl.googlesource.com/boringssl
43e0197994SDmitri Tikhonovcd boringssl
44e0197994SDmitri Tikhonov```
45e0197994SDmitri Tikhonov
465392f7a3SLiteSpeed TechYou may need to install pre-requisites like zlib and libevent.
47e0197994SDmitri Tikhonov
48c38e7df7SDmitri Tikhonov2. Use specific BoringSSL version
49c38e7df7SDmitri Tikhonov
50c38e7df7SDmitri Tikhonov```
51e55a4502SDmitri Tikhonovgit checkout b117a3a0b7bd11fe6ebd503ec6b45d6b910b41a1
52c38e7df7SDmitri Tikhonov```
53c38e7df7SDmitri Tikhonov
544947ba95SDmitri Tikhonov3. Compile the library
55e0197994SDmitri Tikhonov
56e0197994SDmitri Tikhonov```
57e0197994SDmitri Tikhonovcmake . &&  make
58e0197994SDmitri Tikhonov```
59e0197994SDmitri Tikhonov
60199c01abSLiteSpeed TechRemember where BoringSSL sources are:
61e0197994SDmitri Tikhonov```
62199c01abSLiteSpeed TechBORINGSSL=$PWD
63e0197994SDmitri Tikhonov```
64e0197994SDmitri Tikhonov
65199c01abSLiteSpeed TechIf you want to turn on optimizations, do
66e0197994SDmitri Tikhonov
67e0197994SDmitri Tikhonov```
68199c01abSLiteSpeed Techcmake -DCMAKE_BUILD_TYPE=Release . && make
69e0197994SDmitri Tikhonov```
70e0197994SDmitri Tikhonov
71038a9441SAaron FranceIf you want to build as a library, (necessary to build lsquic itself
72038a9441SAaron Franceas as shared library) do:
73038a9441SAaron France
74038a9441SAaron France```
75038a9441SAaron Francecmake -DBUILD_SHARED_LIBS=1 . && make
76038a9441SAaron France```
77038a9441SAaron France
785392f7a3SLiteSpeed TechBuilding LSQUIC Library
795392f7a3SLiteSpeed Tech-----------------------
80e0197994SDmitri Tikhonov
815392f7a3SLiteSpeed TechLSQUIC's `http_client`, `http_server`, and the tests link BoringSSL
825392f7a3SLiteSpeed Techlibraries statically.  Following previous section, you can build LSQUIC
835392f7a3SLiteSpeed Techas follows:
84e0197994SDmitri Tikhonov
8567b0dc15SDmitri Tikhonov1. Get the source code
8667b0dc15SDmitri Tikhonov
8767b0dc15SDmitri Tikhonov```
885392f7a3SLiteSpeed Techgit clone https://github.com/litespeedtech/lsquic.git
895392f7a3SLiteSpeed Techcd lsquic
905392f7a3SLiteSpeed Techgit submodule init
915392f7a3SLiteSpeed Techgit submodule update
9267b0dc15SDmitri Tikhonov```
9367b0dc15SDmitri Tikhonov
9467b0dc15SDmitri Tikhonov2. Compile the library
9567b0dc15SDmitri Tikhonov
96038a9441SAaron FranceStatically:
97038a9441SAaron France
9867b0dc15SDmitri Tikhonov
99e0197994SDmitri Tikhonov```
100199c01abSLiteSpeed Tech# $BORINGSSL is the top-level BoringSSL directory from the previous step
101199c01abSLiteSpeed Techcmake -DBORINGSSL_DIR=$BORINGSSL .
102e0197994SDmitri Tikhonovmake
103e0197994SDmitri Tikhonov```
104e0197994SDmitri Tikhonov
105038a9441SAaron FranceAs a dynamic library:
106038a9441SAaron France
107038a9441SAaron France```
1082e1429b4SDmitri Tikhonovcmake -DLSQUIC_SHARED_LIB=1 -DBORINGSSL_DIR=$BORINGSSL .
109038a9441SAaron Francemake
110038a9441SAaron France```
111038a9441SAaron France
112038a9441SAaron France
11367b0dc15SDmitri Tikhonov3. Run tests
114e0197994SDmitri Tikhonov
115e0197994SDmitri Tikhonov```
116e0197994SDmitri Tikhonovmake test
117e0197994SDmitri Tikhonov```
118e0197994SDmitri Tikhonov
119306ecefeSBrian ProdoehlBuilding with Docker
120306ecefeSBrian Prodoehl---------
12127187418SLiteSpeed TechThe library and the example client and server can be built with Docker.
12227187418SLiteSpeed Tech
12327187418SLiteSpeed TechInitialize Git submodules:
12427187418SLiteSpeed Tech```
12527187418SLiteSpeed Techcd lsquic
12627187418SLiteSpeed Techgit submodule init
12727187418SLiteSpeed Techgit submodule update
12827187418SLiteSpeed Tech```
12927187418SLiteSpeed Tech
13027187418SLiteSpeed TechBuild the Docker image:
131306ecefeSBrian Prodoehl```
1325392f7a3SLiteSpeed Techdocker build -t lsquic .
133306ecefeSBrian Prodoehl```
134306ecefeSBrian Prodoehl
13527187418SLiteSpeed TechThen you can use the examples from the command line.  For example:
136306ecefeSBrian Prodoehl```
13727187418SLiteSpeed Techsudo docker run -it --rm lsquic http_client -s www.google.com  -p / -o version=Q046
13827187418SLiteSpeed Techsudo 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
139306ecefeSBrian Prodoehl```
140306ecefeSBrian Prodoehl
141e0197994SDmitri TikhonovPlatforms
142e0197994SDmitri Tikhonov---------
143e0197994SDmitri Tikhonov
1445392f7a3SLiteSpeed TechThe library has been tested on the following platforms:
145e0197994SDmitri Tikhonov- Linux
146aff2a1d8SDmitri Tikhonov  - i386
147e0197994SDmitri Tikhonov  - x86_64
148e0197994SDmitri Tikhonov  - ARM (Raspberry Pi 3)
149e0197994SDmitri Tikhonov- FreeBSD
150e0197994SDmitri Tikhonov  - i386
151e0197994SDmitri Tikhonov- MacOS
152e0197994SDmitri Tikhonov  - x86_64
1539a690580SDmitri Tikhonov- Android
1549a690580SDmitri Tikhonov  - ARM
155fb3e20e0SDmitri Tikhonov- Windows
1565392f7a3SLiteSpeed Tech  - x86_64
15750aadb33SDmitri Tikhonov
158758aff32SDmitri TikhonovGet Involved
159758aff32SDmitri Tikhonov------------
160758aff32SDmitri Tikhonov
161758aff32SDmitri TikhonovDo not hesitate to report bugs back to us.  Even better, send us fixes
162758aff32SDmitri Tikhonovand improvements!
163758aff32SDmitri Tikhonov
16450aadb33SDmitri TikhonovHave fun,
16550aadb33SDmitri Tikhonov
16650aadb33SDmitri TikhonovLiteSpeed QUIC Team.
16750aadb33SDmitri Tikhonov
168740e26dcSJoshua ReynoldsCopyright (c) 2017 - 2020 LiteSpeed Technologies Inc
169