README.md revision 6259599e
1[![Build Status](https://travis-ci.org/litespeedtech/lsquic-client.svg?branch=master)](https://travis-ci.org/litespeedtech/lsquic-client) 2[![Build Status](https://api.cirrus-ci.com/github/litespeedtech/lsquic-client.svg)](https://cirrus-ci.com/github/litespeedtech/lsquic-client) 3 4LiteSpeed QUIC (LSQUIC) Client Library README 5============================================= 6 7Description 8----------- 9 10LiteSpeed QUIC (LSQUIC) Client Library is an open-source implementation 11of QUIC functionality for clients. It is released in the hope to speed 12the adoption of QUIC. Most of the code in this distribution is used in 13our own products: LiteSpeed Web Server and ADC. We think it is free of 14major problems. Nevertheless, do not hesitate to report bugs back to us. 15Even better, send us fixes and improvements! 16 17Currently supported QUIC versions are Q035, Q039, Q043, and Q044. Support 18for newer versions will be added soon after they are released. The 19version(s) specified by IETF QUIC WG are being developed on 20[one or more branches](https://github.com/litespeedtech/lsquic-client/branches). 21When deemed stable, the IETF QUIC support will be added to the master branch. 22 23Documentation 24------------- 25 26The documentation for this module is admittedly sparse. The API is 27documented in include/lsquic.h. If you have doxygen, you can run 28`doxygen dox.cfg` or `make docs`. The example program is 29test/http_client.c: a bare-bones, but working, QUIC client. Have a look 30in EXAMPLES.txt to see how it can be used. 31 32Requirements 33------------ 34 35To build LSQUIC, you need CMake, zlib, and BoringSSL. The example program 36uses libevent to provide the event loop. 37 38Building BoringSSL 39------------------ 40 41BoringSSL is not packaged; you have to build it yourself. The process is 42straightforward. You will need `go` installed. 43 441. Clone BoringSSL by issuing the following command: 45 46``` 47git clone https://boringssl.googlesource.com/boringssl 48cd boringssl 49``` 50 512. Check out stable branch: 52 53``` 54git checkout chromium-stable 55``` 56 573. Compile the library 58 59``` 60cmake . && make 61``` 62 63If you want to turn on optimizations, do 64 65``` 66cmake -DCMAKE_BUILD_TYPE=Release . && make 67``` 68 694. Install the library 70 71This is the manual step. You will need to copy library files manually. 72LSQUIC client library needs two: `ssl/libssl.a` and `crypto/libcrypto.a`. 73To install these in `/usr/local/lib`, you should do the following: 74 75``` 76BORINGSSL_SOURCE=$PWD 77cd /usr/local/lib 78sudo cp $BORINGSSL_SOURCE/ssl/libssl.a . 79sudo cp $BORINGSSL_SOURCE/crypto/libcrypto.a . 80``` 81 82If you do not want to install the library (or do not have root), you 83can do this instead: 84 85``` 86BORINGSSL_SOURCE=$PWD 87mkdir -p $HOME/tmp/boringssl-libs 88cd $HOME/tmp/boringssl-libs 89ln -s $BORINGSSL_SOURCE/ssl/libssl.a 90ln -s $BORINGSSL_SOURCE/crypto/libcrypto.a 91``` 92 93Building LSQUIC Client Library 94------------------------------ 95 96LSQUIC's `http_client` and the tests link BoringSSL libraries statically. 97Following previous section, you can build LSQUIC as follows: 98 991. Get the source code 100 101``` 102git clone https://github.com/litespeedtech/lsquic-client.git 103cd lsquic-client 104``` 105 1062. Compile the library 107 108 109``` 110cmake -DBORINGSSL_INCLUDE=$BORINGSSL_SOURCE/include \ 111 -DBORINGSSL_LIB=$HOME/tmp/boringssl-libs . 112make 113``` 114 1153. Run tests 116 117``` 118make test 119``` 120 121Building with Docker 122--------- 123The library and http_client example can be built with Docker. 124``` 125docker build -t lsquic-client . 126``` 127 128Then you can use the http_client example from the command line. 129``` 130docker run -it --rm lsquic-client http_client -H www.google.com -s 74.125.22.106:443 -p / 131``` 132 133Platforms 134--------- 135 136The client library has been tested on the following platforms: 137- Linux 138 - i386 139 - x86_64 140 - ARM (Raspberry Pi 3) 141- FreeBSD 142 - i386 143- Windows 144 - x86_64 145- MacOS 146 - x86_64 147 148Have fun, 149 150LiteSpeed QUIC Team. 151 152Copyright (c) 2017 - 2018 LiteSpeed Technologies Inc 153