Skip to content

mfavant/avant

Repository files navigation

Avant

Docker Image CI

Network Message Framework For Linux C++.

C++ Version: C++20
OS: Linux
Protocol: HTTP TCP Stream(protobuf) Websocket
TLS/SSL: OpenSSL
Script Engin: Lua 5.4.6

Docker Image

docker run --privileged -p 20023:20023 -v ${LOCAL_HTTP_DIR_PATH}:/avant_static gaowanlu/avant:latest

Get Start

If there are already dependencies to be installed on the host, please selectively ignore them.

Ubuntu (Docker)

docker run -it ubuntu
sudo apt-get update
sudo apt-get install apt-utils -y
sudo apt-get install cmake g++ make git -y
sudo apt-get install protobuf-compiler libprotobuf-dev -y
sudo apt-get install libssl-dev -y
git clone https://github.com/crust-hub/avant.git
cd avant
cd protocol
make
cd ..
mkdir build
rm -rf ./build/*
cd build
cmake ..
make -j4

CentOS8 (Docker)

centos8

Config File

sudo mkdir /avant_static
vim bin/config/main.ini

Start

cd bin
./avant
ps -ef | grep avant

Stop

ps -ef | grep avant
kill PID

App-Layer

support tcp keep-alive stream (protobuf) and http app (http-parser)、websocket

  1. framework config
  2. stream protobuf app
  3. http app
  4. websocket app

Client

Lua

The main thread, other thread, and each worker thread have their own independent Lua virtual machine. config/Init.lua

Lua Hot Update

Using signal SIGUSR1(10), Avant provides Lua hot updates without restarting the process.

ps -ef | grep avant
kill -10 PID

IPC

The configuration file is located at config/ipc.json. Adopt one-way TCP active connection. Authentication handshake is verified through the appid content in ProtoIPCStreamAuthHandshake protocol.

Wrk

wrk tool

# avant
wrk -c {{connection_num}} -t {{threads}} http://IP:20023/
wrk -c {{connection_num}} -t {{threads}} -d60s --header "Connection: keep-alive" http://127.0.0.1:20023/

Third-Party

1、@nodejs/http-parser 2、@lua/lua
3、@protocolbuffers/protobuf 4、@openssl/openssl
5、@madler/zlib 6、@homer6/url

Releases

No releases published

Packages

No packages published