-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #174 from Quicr/mv2moq
Implement draft-ietf-moq-transport-04
- Loading branch information
Showing
24 changed files
with
9,301 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,113 +1,46 @@ | ||
libquicr | ||
======== | ||
|
||
[![CMake](https://github.com/Quicr/libquicr/actions/workflows/cmake.yml/badge.svg?branch=main)](https://github.com/Quicr/libquicr/actions/workflows/cmake.yml) | ||
[![Build](https://github.com/Quicr/libquicr/actions/workflows/cmake.yml/badge.svg?branch=main)](https://github.com/Quicr/libquicr/actions/workflows/cmake.yml) | ||
|
||
Implementation of transport layer api based on QuicR. | ||
Please see for further details | ||
[QuicR Protocol](https://www.ietf.org/id/draft-jennings-moq-quicr-proto-01.html) | ||
|
||
The actual protocol implementation is covered [here](https://github.com/Quicr/quicrq). | ||
|
||
Quickstart | ||
---------- | ||
An API library that implements publish/subscribe protocol [draft-ietf-moq-transport-04](https://datatracker.ietf.org/doc/html/draft-ietf-moq-transport-04). | ||
The API supports both client and server. Server is intended to be implemented as a relay. | ||
|
||
### Build | ||
Use `make` to build libquicr. | ||
|
||
Use `make test` to run tests. | ||
|
||
### Build without InfluxDB | ||
|
||
To build without InfluxDB, run `cmake` with `-DLIBQUICR_WITHOUT_INFLUXDB=ON` | ||
|
||
### Cmake FetchContent | ||
|
||
All the dependecies are now fetched via cmake and below steps should | ||
build libquicr.a | ||
|
||
``` | ||
brew install openssl | ||
export PKG_CONFIG_PATH="/opt/homebrew/opt/openssl@3/lib/pkgconfig" | ||
git clone git@github.com:Quicr/libquicr.git | ||
cd libquicr | ||
git submodule update --init --recursive | ||
mkdir build | ||
cd build | ||
cmake .. | ||
make all | ||
``` | ||
|
||
### Build Docker Dev Image | ||
If building docker image is the preferred option, please follow the below steps | ||
|
||
The developer image contains ```picotls```, ```picoquic``` and ```quicrq```, which are required | ||
for many other builds. The container works by running it with a volume mount ```/ws/src``` | ||
to the source to be compiled. The above libraries are in the ```/ws/``` directory, which is expected for builds. | ||
|
||
While ```quicrq``` is included under ```/ws/quicrq```, the container can be used to develop and compile | ||
it by mounting ```quicrq``` directory to ```/ws/src```. | ||
|
||
The docker container has been tested to work for both ARM (M1/Apple Silicon) and x86. | ||
Use `make cclean` to clean build files. | ||
|
||
``` | ||
git clone git@github.com:Quicr/libquicr.git | ||
cd libquicr | ||
tar -c -C ../ ./quicrq ./libquicr \ | ||
| docker buildx build --progress=plain \ | ||
--output type=docker \ | ||
-f libquicr/build.Dockerfile -t quicr/libquicr:latest - | ||
``` | ||
|
||
``` | ||
cd <libquicr directory> | ||
rm -rf $(pwd)/build | ||
docker run --rm \ | ||
-v $(pwd):/ws/src \ | ||
quicr/libquicr:latest make all | ||
``` | ||
|
||
For now, it's best to run the binaries in interactive shell. The images have been built for linux. Run | ||
the image in interactive mode to access the shell prompt. From there you can access the binaries. | ||
```quicrq``` and others are located under ```/ws/```. For example, you can run ```/ws/quircq/quicrq_app``` binary. | ||
|
||
``` | ||
docker run --rm -it \ | ||
-v $(pwd):/ws/src \ | ||
quicr/libquicr:latest bash | ||
``` | ||
### Build without InfluxDB | ||
|
||
Running Examples | ||
-------------- | ||
To build without InfluxDB, run `cmake` with `-DLIBQUICR_WITHOUT_INFLUXDB=ON` | ||
|
||
### Running Relays/Etc. | ||
### Self-signed Certificate | ||
|
||
In order to test QUIC, the server/```really``` needs to have a certificate. The program expects | ||
the | ||
Server requires a TLS certificate and key file. For development and testing, use a self-signed certificate. Below | ||
are the steps to create a self-signed certificate and private ey. | ||
|
||
Generate self-signed certificate for really server to test with. | ||
#### OpenSSL/BorningSSL | ||
|
||
``` | ||
cd build/cmd/really | ||
cd build/cmd/moq-example | ||
openssl req -nodes -x509 -newkey rsa:2048 -days 365 \ | ||
-subj "/C=US/ST=CA/L=San Jose/O=Cisco/CN=test.quicr.ctgpoc.com" \ | ||
-subj "/C=US/ST=CA/L=San Jose/O=Cisco/CN=test.m10x.org" \ | ||
-keyout server-key.pem -out server-cert.pem | ||
``` | ||
|
||
#### MbedTLS cert | ||
#### MbedTLS | ||
|
||
``` | ||
openssl req -nodes -x509 -newkey ec:<(openssl ecparam -name secp256r1) -days 365 \ | ||
-subj "/C=US/ST=CA/L=San Jose/O=Cisco/CN=test.quicr.ctgpoc.com" \ | ||
-subj "/C=US/ST=CA/L=San Jose/O=Cisco/CN=test.m10x.org" \ | ||
-keyout server-key.pem -out server-cert.pem | ||
``` | ||
|
||
Run: | ||
|
||
``` | ||
cd build/cmd/really | ||
./really | ||
|
||
./reallyTest | ||
### MOQ Implementation Documentation | ||
|
||
See [MOQ Implementation](docs/moq-implementation.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#add_subdirectory(qcurl) | ||
add_subdirectory(really) | ||
|
||
add_subdirectory(moq-example) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
|
||
add_executable(qserver | ||
server.cpp | ||
) | ||
target_link_libraries(qserver PRIVATE quicr) | ||
|
||
if(NOT LIBQUICR_WITHOUT_INFLUXDB) | ||
target_link_libraries(qserver | ||
PRIVATE InfluxData::InfluxDB) | ||
endif() | ||
|
||
|
||
target_compile_options(qserver | ||
PRIVATE | ||
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>: -Wpedantic -Wextra -Wall> | ||
$<$<CXX_COMPILER_ID:MSVC>: >) | ||
|
||
set_target_properties(qserver | ||
PROPERTIES | ||
CXX_STANDARD 20 | ||
CXX_STANDARD_REQUIRED YES | ||
CXX_EXTENSIONS ON) | ||
|
||
if(CLANG_TIDY_EXE) | ||
set_target_properties(quicr PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_EXE}") | ||
endif() | ||
|
||
|
||
add_executable(qclient client.cpp) | ||
|
||
target_link_libraries(qclient PRIVATE quicr) | ||
|
||
if(NOT LIBQUICR_WITHOUT_INFLUXDB) | ||
target_link_libraries(qclient | ||
PRIVATE InfluxData::InfluxDB) | ||
endif() | ||
|
||
target_compile_options(qclient | ||
PRIVATE | ||
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>: -Wpedantic -Wextra -Wall> | ||
$<$<CXX_COMPILER_ID:MSVC>: >) | ||
|
||
|
||
set_target_properties(qclient | ||
PROPERTIES | ||
CXX_STANDARD 20 | ||
CXX_STANDARD_REQUIRED YES | ||
CXX_EXTENSIONS OFF) |
Oops, something went wrong.