README.md revision c38e7df7
15392f7a3SLiteSpeed Tech[![Build Status](https://travis-ci.org/litespeedtech/lsquic.svg?branch=master)](https://travis-ci.org/litespeedtech/lsquic)
25392f7a3SLiteSpeed Tech[![Build Status](https://api.cirrus-ci.com/github/litespeedtech/lsquic.svg)](https://cirrus-ci.com/github/litespeedtech/lsquic)
35392f7a3SLiteSpeed Tech[![Build status](https://ci.appveyor.com/api/projects/status/kei9649t9leoqicr?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
125392f7a3SLiteSpeed Techfunctionality for servers and clients.  It is released in the hope to speed
1350aadb33SDmitri Tikhonovthe adoption of QUIC.  Most of the code in this distribution is used in
145392f7a3SLiteSpeed Techour own products: LiteSpeed Web Server, LiteSpeed ADC, and OpenLiteSpeed.
155392f7a3SLiteSpeed TechWe think it is free of major problems.  Nevertheless, do not hesitate to
165392f7a3SLiteSpeed Techreport bugs back to us.  Even better, send us fixes and improvements!
1750aadb33SDmitri Tikhonov
185392f7a3SLiteSpeed TechCurrently supported QUIC versions are Q039, Q043, Q046, and ID-22.  Support
195392f7a3SLiteSpeed Techfor newer versions will be added soon after they are released.
2050aadb33SDmitri Tikhonov
2150aadb33SDmitri TikhonovDocumentation
2250aadb33SDmitri Tikhonov-------------
2350aadb33SDmitri Tikhonov
2450aadb33SDmitri TikhonovThe documentation for this module is admittedly sparse.  The API is
2550aadb33SDmitri Tikhonovdocumented in include/lsquic.h.  If you have doxygen, you can run
26e0197994SDmitri Tikhonov`doxygen dox.cfg` or `make docs`.  The example program is
2750aadb33SDmitri Tikhonovtest/http_client.c: a bare-bones, but working, QUIC client.  Have a look
2850aadb33SDmitri Tikhonovin EXAMPLES.txt to see how it can be used.
2950aadb33SDmitri Tikhonov
30e0197994SDmitri TikhonovRequirements
31e0197994SDmitri Tikhonov------------
3250aadb33SDmitri Tikhonov
33e0197994SDmitri TikhonovTo build LSQUIC, you need CMake, zlib, and BoringSSL.  The example program
34e0197994SDmitri Tikhonovuses libevent to provide the event loop.
3550aadb33SDmitri Tikhonov
36e0197994SDmitri TikhonovBuilding BoringSSL
37e0197994SDmitri Tikhonov------------------
38e0197994SDmitri Tikhonov
39e0197994SDmitri TikhonovBoringSSL is not packaged; you have to build it yourself.  The process is
40e0197994SDmitri Tikhonovstraightforward.  You will need `go` installed.
41e0197994SDmitri Tikhonov
42e0197994SDmitri Tikhonov1. Clone BoringSSL by issuing the following command:
43e0197994SDmitri Tikhonov
44e0197994SDmitri Tikhonov```
45e0197994SDmitri Tikhonovgit clone https://boringssl.googlesource.com/boringssl
46e0197994SDmitri Tikhonovcd boringssl
47e0197994SDmitri Tikhonov```
48e0197994SDmitri Tikhonov
495392f7a3SLiteSpeed TechYou may need to install pre-requisites like zlib and libevent.
50e0197994SDmitri Tikhonov
51c38e7df7SDmitri Tikhonov2. Use specific BoringSSL version
52c38e7df7SDmitri Tikhonov
53c38e7df7SDmitri Tikhonov```
54c38e7df7SDmitri Tikhonovgit checkout 32e59d2d3264e4e104b355ef73663b8b79ac4093
55c38e7df7SDmitri Tikhonov```
56c38e7df7SDmitri Tikhonov
57c38e7df7SDmitri Tikhonov3. Patch the library
58c38e7df7SDmitri Tikhonov
59c38e7df7SDmitri TikhonovThis patch is required for IETF QUIC support.
60c38e7df7SDmitri Tikhonov
61c38e7df7SDmitri Tikhonov```
62c38e7df7SDmitri Tikhonovpatch -p1 -i ../patches/boringssl-meds.patch
63c38e7df7SDmitri Tikhonov```
64c38e7df7SDmitri Tikhonov
65c38e7df7SDmitri Tikhonov4. Compile the library
66e0197994SDmitri Tikhonov
67e0197994SDmitri Tikhonov```
68e0197994SDmitri Tikhonovcmake . &&  make
69e0197994SDmitri Tikhonov```
70e0197994SDmitri Tikhonov
71199c01abSLiteSpeed TechRemember where BoringSSL sources are:
72e0197994SDmitri Tikhonov```
73199c01abSLiteSpeed TechBORINGSSL=$PWD
74e0197994SDmitri Tikhonov```
75e0197994SDmitri Tikhonov
76199c01abSLiteSpeed TechIf you want to turn on optimizations, do
77e0197994SDmitri Tikhonov
78e0197994SDmitri Tikhonov```
79199c01abSLiteSpeed Techcmake -DCMAKE_BUILD_TYPE=Release . && make
80e0197994SDmitri Tikhonov```
81e0197994SDmitri Tikhonov
825392f7a3SLiteSpeed TechBuilding LSQUIC Library
835392f7a3SLiteSpeed Tech-----------------------
84e0197994SDmitri Tikhonov
855392f7a3SLiteSpeed TechLSQUIC's `http_client`, `http_server`, and the tests link BoringSSL
865392f7a3SLiteSpeed Techlibraries statically.  Following previous section, you can build LSQUIC
875392f7a3SLiteSpeed Techas follows:
88e0197994SDmitri Tikhonov
8967b0dc15SDmitri Tikhonov1. Get the source code
9067b0dc15SDmitri Tikhonov
9167b0dc15SDmitri Tikhonov```
925392f7a3SLiteSpeed Techgit clone https://github.com/litespeedtech/lsquic.git
935392f7a3SLiteSpeed Techcd lsquic
945392f7a3SLiteSpeed Techgit submodule init
955392f7a3SLiteSpeed Techgit submodule update
9667b0dc15SDmitri Tikhonov```
9767b0dc15SDmitri Tikhonov
9867b0dc15SDmitri Tikhonov2. Compile the library
9967b0dc15SDmitri Tikhonov
10067b0dc15SDmitri Tikhonov
101e0197994SDmitri Tikhonov```
102199c01abSLiteSpeed Tech# $BORINGSSL is the top-level BoringSSL directory from the previous step
103199c01abSLiteSpeed Techcmake -DBORINGSSL_DIR=$BORINGSSL .
104e0197994SDmitri Tikhonovmake
105e0197994SDmitri Tikhonov```
106e0197994SDmitri Tikhonov
10767b0dc15SDmitri Tikhonov3. Run tests
108e0197994SDmitri Tikhonov
109e0197994SDmitri Tikhonov```
110e0197994SDmitri Tikhonovmake test
111e0197994SDmitri Tikhonov```
112e0197994SDmitri Tikhonov
113306ecefeSBrian ProdoehlBuilding with Docker
114306ecefeSBrian Prodoehl---------
115306ecefeSBrian ProdoehlThe library and http_client example can be built with Docker.
116306ecefeSBrian Prodoehl```
1175392f7a3SLiteSpeed Techdocker build -t lsquic .
118306ecefeSBrian Prodoehl```
119306ecefeSBrian Prodoehl
120306ecefeSBrian ProdoehlThen you can use the http_client example from the command line.
121306ecefeSBrian Prodoehl```
1225392f7a3SLiteSpeed Techdocker run -it --rm lsquic http_client -H www.google.com -s 74.125.22.106:443 -p /
123306ecefeSBrian Prodoehl```
124306ecefeSBrian Prodoehl
125e0197994SDmitri TikhonovPlatforms
126e0197994SDmitri Tikhonov---------
127e0197994SDmitri Tikhonov
1285392f7a3SLiteSpeed TechThe library has been tested on the following platforms:
129e0197994SDmitri Tikhonov- Linux
130aff2a1d8SDmitri Tikhonov  - i386
131e0197994SDmitri Tikhonov  - x86_64
132e0197994SDmitri Tikhonov  - ARM (Raspberry Pi 3)
133e0197994SDmitri Tikhonov- FreeBSD
134e0197994SDmitri Tikhonov  - i386
135e0197994SDmitri Tikhonov- MacOS
136e0197994SDmitri Tikhonov  - x86_64
1375392f7a3SLiteSpeed Tech- Windows (this needs updating for the server part, now broken)
1385392f7a3SLiteSpeed Tech  - x86_64
13950aadb33SDmitri Tikhonov
14050aadb33SDmitri TikhonovHave fun,
14150aadb33SDmitri Tikhonov
14250aadb33SDmitri TikhonovLiteSpeed QUIC Team.
14350aadb33SDmitri Tikhonov
1445392f7a3SLiteSpeed TechCopyright (c) 2017 - 2019 LiteSpeed Technologies Inc
145