README.md revision 4ffff819
1eb023232SDmitri Tikhonov[![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) 2eb023232SDmitri Tikhonov[![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) 3eb023232SDmitri Tikhonov[![FreeBSD build status](https://api.cirrus-ci.com/github/litespeedtech/lsquic.svg)](https://cirrus-ci.com/github/litespeedtech/lsquic) 44ffff819SLiteSpeed Tech[![Documentation Status](https://readthedocs.org/projects/lsquic/badge/?version=latest)](https://lsquic.readthedocs.io/en/latest/?badge=latest) 51fc8f998SDmitri Tikhonov 65392f7a3SLiteSpeed TechLiteSpeed QUIC (LSQUIC) Library README 750aadb33SDmitri Tikhonov============================================= 850aadb33SDmitri Tikhonov 950aadb33SDmitri TikhonovDescription 1050aadb33SDmitri Tikhonov----------- 1150aadb33SDmitri Tikhonov 125392f7a3SLiteSpeed TechLiteSpeed QUIC (LSQUIC) Library is an open-source implementation of QUIC 13f87fb49cSDmitri Tikhonovand HTTP/3 functionality for servers and clients. Most of the code in this 14f87fb49cSDmitri Tikhonovdistribution is used in our own products: LiteSpeed Web Server, LiteSpeed ADC, 15758aff32SDmitri Tikhonovand OpenLiteSpeed. 1650aadb33SDmitri Tikhonov 1726e8f082SDmitri TikhonovCurrently supported QUIC versions are v1 (disabled by default until the 1826e8f082SDmitri TikhonovQUIC RFC is released); Internet-Draft versions 34, 29, and 27; 1926e8f082SDmitri Tikhonovand the older "Google" QUIC versions Q043, Q046, an Q050. 2050aadb33SDmitri Tikhonov 2150aadb33SDmitri TikhonovDocumentation 2250aadb33SDmitri Tikhonov------------- 2350aadb33SDmitri Tikhonov 24a5fa05f9SDmitri TikhonovDocumentation is available at https://lsquic.readthedocs.io/en/latest/. 25a5fa05f9SDmitri Tikhonov 26a5fa05f9SDmitri TikhonovIn addition, see example programs for API usage and EXAMPLES.txt for 27a5fa05f9SDmitri Tikhonovsome compilation and run-time options. 2850aadb33SDmitri Tikhonov 29e0197994SDmitri TikhonovRequirements 30e0197994SDmitri Tikhonov------------ 3150aadb33SDmitri Tikhonov 32e0197994SDmitri TikhonovTo build LSQUIC, you need CMake, zlib, and BoringSSL. The example program 33e0197994SDmitri Tikhonovuses libevent to provide the event loop. 3450aadb33SDmitri Tikhonov 35e0197994SDmitri TikhonovBuilding BoringSSL 36e0197994SDmitri Tikhonov------------------ 37e0197994SDmitri Tikhonov 38e0197994SDmitri TikhonovBoringSSL is not packaged; you have to build it yourself. The process is 39e0197994SDmitri Tikhonovstraightforward. You will need `go` installed. 40e0197994SDmitri Tikhonov 41e0197994SDmitri Tikhonov1. Clone BoringSSL by issuing the following command: 42e0197994SDmitri Tikhonov 43e0197994SDmitri Tikhonov``` 44e0197994SDmitri Tikhonovgit clone https://boringssl.googlesource.com/boringssl 45e0197994SDmitri Tikhonovcd boringssl 46e0197994SDmitri Tikhonov``` 47e0197994SDmitri Tikhonov 485392f7a3SLiteSpeed TechYou may need to install pre-requisites like zlib and libevent. 49e0197994SDmitri Tikhonov 50c38e7df7SDmitri Tikhonov2. Use specific BoringSSL version 51c38e7df7SDmitri Tikhonov 52c38e7df7SDmitri Tikhonov``` 5326e8f082SDmitri Tikhonovgit checkout a2278d4d2cabe73f6663e3299ea7808edfa306b9 54c38e7df7SDmitri Tikhonov``` 55c38e7df7SDmitri Tikhonov 564947ba95SDmitri Tikhonov3. Compile the library 57e0197994SDmitri Tikhonov 58e0197994SDmitri Tikhonov``` 59e0197994SDmitri Tikhonovcmake . && make 60e0197994SDmitri Tikhonov``` 61e0197994SDmitri Tikhonov 62199c01abSLiteSpeed TechRemember where BoringSSL sources are: 63e0197994SDmitri Tikhonov``` 64199c01abSLiteSpeed TechBORINGSSL=$PWD 65e0197994SDmitri Tikhonov``` 66e0197994SDmitri Tikhonov 67199c01abSLiteSpeed TechIf you want to turn on optimizations, do 68e0197994SDmitri Tikhonov 69e0197994SDmitri Tikhonov``` 70199c01abSLiteSpeed Techcmake -DCMAKE_BUILD_TYPE=Release . && make 71e0197994SDmitri Tikhonov``` 72e0197994SDmitri Tikhonov 73038a9441SAaron FranceIf you want to build as a library, (necessary to build lsquic itself 74038a9441SAaron Franceas as shared library) do: 75038a9441SAaron France 76038a9441SAaron France``` 77038a9441SAaron Francecmake -DBUILD_SHARED_LIBS=1 . && make 78038a9441SAaron France``` 79038a9441SAaron France 805392f7a3SLiteSpeed TechBuilding LSQUIC Library 815392f7a3SLiteSpeed Tech----------------------- 82e0197994SDmitri Tikhonov 835392f7a3SLiteSpeed TechLSQUIC's `http_client`, `http_server`, and the tests link BoringSSL 845392f7a3SLiteSpeed Techlibraries statically. Following previous section, you can build LSQUIC 855392f7a3SLiteSpeed Techas follows: 86e0197994SDmitri Tikhonov 8767b0dc15SDmitri Tikhonov1. Get the source code 8867b0dc15SDmitri Tikhonov 8967b0dc15SDmitri Tikhonov``` 905392f7a3SLiteSpeed Techgit clone https://github.com/litespeedtech/lsquic.git 915392f7a3SLiteSpeed Techcd lsquic 925392f7a3SLiteSpeed Techgit submodule init 935392f7a3SLiteSpeed Techgit submodule update 9467b0dc15SDmitri Tikhonov``` 9567b0dc15SDmitri Tikhonov 9667b0dc15SDmitri Tikhonov2. Compile the library 9767b0dc15SDmitri Tikhonov 98038a9441SAaron FranceStatically: 99038a9441SAaron France 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 107038a9441SAaron FranceAs a dynamic library: 108038a9441SAaron France 109038a9441SAaron France``` 1102e1429b4SDmitri Tikhonovcmake -DLSQUIC_SHARED_LIB=1 -DBORINGSSL_DIR=$BORINGSSL . 111038a9441SAaron Francemake 112038a9441SAaron France``` 113038a9441SAaron France 114038a9441SAaron France 11567b0dc15SDmitri Tikhonov3. Run tests 116e0197994SDmitri Tikhonov 117e0197994SDmitri Tikhonov``` 118e0197994SDmitri Tikhonovmake test 119e0197994SDmitri Tikhonov``` 120e0197994SDmitri Tikhonov 121306ecefeSBrian ProdoehlBuilding with Docker 122306ecefeSBrian Prodoehl--------- 12327187418SLiteSpeed TechThe library and the example client and server can be built with Docker. 12427187418SLiteSpeed Tech 12527187418SLiteSpeed TechInitialize Git submodules: 12627187418SLiteSpeed Tech``` 12727187418SLiteSpeed Techcd lsquic 12827187418SLiteSpeed Techgit submodule init 12927187418SLiteSpeed Techgit submodule update 13027187418SLiteSpeed Tech``` 13127187418SLiteSpeed Tech 13227187418SLiteSpeed TechBuild the Docker image: 133306ecefeSBrian Prodoehl``` 1345392f7a3SLiteSpeed Techdocker build -t lsquic . 135306ecefeSBrian Prodoehl``` 136306ecefeSBrian Prodoehl 13727187418SLiteSpeed TechThen you can use the examples from the command line. For example: 138306ecefeSBrian Prodoehl``` 13927187418SLiteSpeed Techsudo docker run -it --rm lsquic http_client -s www.google.com -p / -o version=Q046 14027187418SLiteSpeed 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 141306ecefeSBrian Prodoehl``` 142306ecefeSBrian Prodoehl 143e0197994SDmitri TikhonovPlatforms 144e0197994SDmitri Tikhonov--------- 145e0197994SDmitri Tikhonov 1465392f7a3SLiteSpeed TechThe library has been tested on the following platforms: 147e0197994SDmitri Tikhonov- Linux 148aff2a1d8SDmitri Tikhonov - i386 149e0197994SDmitri Tikhonov - x86_64 150e0197994SDmitri Tikhonov - ARM (Raspberry Pi 3) 151e0197994SDmitri Tikhonov- FreeBSD 152e0197994SDmitri Tikhonov - i386 153e0197994SDmitri Tikhonov- MacOS 154e0197994SDmitri Tikhonov - x86_64 1559a690580SDmitri Tikhonov- Android 1569a690580SDmitri Tikhonov - ARM 157fb3e20e0SDmitri Tikhonov- Windows 1585392f7a3SLiteSpeed Tech - x86_64 15950aadb33SDmitri Tikhonov 160758aff32SDmitri TikhonovGet Involved 161758aff32SDmitri Tikhonov------------ 162758aff32SDmitri Tikhonov 163758aff32SDmitri TikhonovDo not hesitate to report bugs back to us. Even better, send us fixes 164758aff32SDmitri Tikhonovand improvements! 165758aff32SDmitri Tikhonov 16650aadb33SDmitri TikhonovHave fun, 16750aadb33SDmitri Tikhonov 16850aadb33SDmitri TikhonovLiteSpeed QUIC Team. 16950aadb33SDmitri Tikhonov 1701a0003e3SDmitri TikhonovCopyright (c) 2017 - 2021 LiteSpeed Technologies Inc 171