Thanks to visit codestin.com
Credit goes to github.com

Skip to content

anyks/awh

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ANYKS - WEB HUB

ANYKS - WEB HUB (AWH) C++

Project goals and features

  • HTTP / HTTPS: WEB - CLIENT / SERVER.
  • WS / WSS: WebSocket - CLIENT / SERVER.
  • Proxy: HTTP(S) / SOCKS5 PROXY - CLIENT / SERVER.
  • Compress: GZIP / BZIP2 / ZSTD / LZ4 / LZMA / DEFLATE / BROTLI - compression support.
  • Authentication: BASIC / DIGEST - authentication support.

Supported protocols

  • HTTP/1.1 (RFC 9112)
  • HTTP/2 (RFC-9113)
  • HTTP/3 (RFC-9114)

Requirements

To build and launch the project

To clone the project

$ git clone --recursive https://gitflic.ru/project/anyks/awh.git

Activate SCTP only (FreeBSD / Linux)

FreeBSD

$ sudo kldload sctp

Linux (ALT)

$ sudo apt-get install liblksctp-devel
$ sudo modprobe sctp
$ sudo sysctl -w net.sctp.auth_enable=1

Linux (Ubuntu)

$ sudo apt install libsctp-dev
$ sudo modprobe sctp
$ sudo sysctl -w net.sctp.auth_enable=1

Linux (Fedora)

$ sudo yum install lksctp-tools-devel
$ sudo modprobe sctp
$ sudo sysctl -w net.sctp.auth_enable=1

Linux (openSUSE)

$ sudo zypper install lksctp-tools-devel
$ sudo modprobe sctp
$ sudo sysctl -w net.sctp.auth_enable=1
$ cd ./sh/certificates
$ ./generate.sh example.com

Build third party

$ ./sh/build_third_party.sh

Build on MacOS X, Linux, FreeBSD or Solaris

$ mkdir ./build
$ cd ./build

$ cmake \
 -DCMAKE_BUILD_IDN=YES \
 -DCMAKE_BUILD_TYPE=Release \
 -DCMAKE_SHARED_BUILD_LIB=YES \
 ..

$ make

Build on Windows [MSYS2 MinGW]

Development environment configuration

Assembly is done in MSYS2 - MINGW64 terminal

$ pacman -Syuu
$ pacman -Ss cmake
$ pacman -S mingw64/mingw-w64-x86_64-cmake
$ pacman -S make
$ pacman -S curl
$ pacman -S wget
$ pacman -S mc
$ pacman -S gdb
$ pacman -S bash
$ pacman -S clang
$ pacman -S git
$ pacman -S autoconf
$ pacman -S --needed base-devel mingw-w64-x86_64-toolchain
$ pacman -S mingw-w64-x86_64-dlfcn

Project build

$ mkdir ./build
$ cd ./build

$ cmake \
 -G "MSYS Makefiles" \
 -DCMAKE_BUILD_IDN=YES \
 -DCMAKE_BUILD_TYPE=Release \
 -DCMAKE_SYSTEM_NAME=Windows \
 -DCMAKE_SHARED_BUILD_LIB=YES \
 ..

$ cmake --build .

Make installation packages

Build PKG package for MacOS X

# Build installation package
$ ./sh/dist/macos_make_installer.sh

Build EXE installator for MS Windows

# Build installation package
$ ./sh/dist/windows_make_installer.sh

Build P5P package for Solaris

# Build installation package
$ ./sh/dist/solaris_make_installer.sh

# Install AWH library
$ sudo pkg install -g awh_X.X.X-1_i86pc.p5p awh

# Registering installed components
$ sudo postinstall-awh

Build TAR.GZ package for FreeBSD

# Build installation package
$ ./sh/dist/freebsd_make_tar.sh

# Install AWH library
$ sudo tar -xzvf awh_X.X.X_FreeBSD_amd64.tar.gz -C /

Build DEB package for Linux (Astra, Ubuntu, Debian, Deepin)

# Build installation package
$ ./sh/dist/linux_make_deb.sh

# Install AWH library
sudo dpkg -i awh_X.X.X-X~X_amd64.deb

Build RPM package for Linux (ALT, RedOS, Fedora, openSUSE, CentOS, RedHat)

# Build installation package
$ ./sh/dist/linux_make_rpm.sh

# Install AWH library
sudo rpm -i glb-X.X.X-X.X_amd64.rpm

Example include AWH in your project

Example c++ project

// main.cpp
// cmake -DCMAKE_SHARED_LIB_AWH=YES ..
#include <iostream>
#include <awh/sys/lib.hpp>

int main(){
    std::cout << "AWH Version: " << AWH_VERSION << std::endl;
    return 0;
}

Example cmake project

cmake_minimum_required(VERSION 3.16)

project(my_app LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)

find_package(AWH REQUIRED)

if (AWH_FOUND)
    message(STATUS "AWH found: " ${AWH_LIBRARY} " " ${AWH_LIBRARY_DLL} " " ${AWH_INCLUDE_DIR})
else (AWH_FOUND)
    message(FATAL_ERROR "AWH not found")
endif (AWH_FOUND)

add_executable(my_app main.cpp)

target_link_libraries(my_app PRIVATE ${AWH_LIBRARY})

Example project build for MacOS X, Linux, FreeBSD or Solaris

$ mkdir ./build
$ cd ./build

$ cmake \
 -DCMAKE_BUILD_IDN=YES \
 -DCMAKE_BUILD_TYPE=Release \
 -DCMAKE_SHARED_LIB_AWH=YES \
 ..

$ cmake --build .

Example project build for MS Windows

$ mkdir ./build
$ cd ./build

$ cmake \
 -G "MSYS Makefiles" \
 -DCMAKE_BUILD_IDN=YES \
 -DCMAKE_BUILD_TYPE=Release \
 -DCMAKE_SYSTEM_NAME=Windows \
 -DCMAKE_SHARED_LIB_AWH=YES \
 ..

$ cmake --build .

Example client


Example server