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