Skip to content

lanstat/cdn-uring

Repository files navigation

CDN Uring

CMake gem

CDN/HLS powered by liburing

Http multiplexer connection

Table of Contents

Build

Prerequisites

Kernel 5.6+

Ubuntu

sudo apt-get install -y libssl-dev liburing-dev

Archlinux

sudo pacman -S liburing openssl

Make

cd build
cmake ../
make

Usage

Server

./cdn [arguments]
./cdn -ssl -server-port=8001 &
./cdn -server-port=8000 -dns-port=50060 &

Nginx

http {
  upstream http_stream {
    server 127.0.0.1:8000;
  }
  
  upstream https_stream {
    server 127.0.0.1:8001;
  }

  server {
    listen 80;
    server_name _;
    location / {
      proxy_pass http://http_stream;
    }
  }
  
  server {
    listen 443;
    server_name _;
    location / {
      proxy_pass http://https_stream;
    }
  }
}

Client

wget https://localhost/upload.wikimedia.org/wikipedia/commons/3/35/Tux.svg
wget http://localhost/upload.wikimedia.org/wikipedia/commons/3/35/Tux.svg

Arguments

  • -ssl Enable https support
  • -debug Print debug logs
  • -hls Enable hls mode
  • -silent Disable all logs
  • -server-port=### Define the listener port, default 8000
  • -dns-port=### Define the dns listener port, default 50053
  • -buffer-size=### Buffer I/O size
  • -no-cache Disable the cache storage
  • -ipv6 Listen ipv6
  • -proxy=### Proxy to mask the request, ex -proxy=google.com
  • -host-file=### File with static host

TODO

  • Add perfomance test
  • Add error handling on http external request
  • Add admin manager
  • Add Log to file

About

CDN/HLS stream multiplexer

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages