GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - AlkaidLab/intertwine-cpp-framework: C++11 framework for HTTP/HTTPS, TCP, WebSocket, middleware, async tasks, and file transfer.

BranchesTags
Open more actions menu

Latest commit

 

History

64 Commits
64 Commits

Folders and files

NameName
Last commit message
Last commit date
cmake
cmake
 
 
doc
doc
 
 
doc_en
doc_en
 
 
include/intertwine/fw
include/intertwine/fw
 
 
src
src
 
 
test
test
 
 
third_party
third_party
 
 
.gitignore
.gitignore
 
 
.gitmodules
.gitmodules
 
 
CMakeLists.txt
CMakeLists.txt
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build-libhv.ps1
build-libhv.ps1
 
 
build-libhv.sh
build-libhv.sh
 
 
build.ps1
build.ps1
 
 
build.sh
build.sh
 
 
vcpkg.json
vcpkg.json
 
 

Repository files navigation

AlkaidLab intertwine-cpp-framework

瑶光·捕梦网 C++ 框架

C++11 CMake License

面向服务端程序的 C++11 基础框架。它在 libhv 之上提供路由、中间件、HTTP/HTTPS/TCP/WebSocket 传输、文件发送、异步任务和常用工具组件。

公开 API 位于 intertwine::fw,CMake 包与链接目标为 intertwine_cpp_framework。

中文文档 · English documentation

适用场景

能力 组件
HTTP 服务 Application、Router、Context、MiddlewareChain
客户端通信 ITransport、TransportFactory
文件发送 IFileTransfer、FileTransferFactory
并发控制 SupervisedThreadPool、LockfreeQueue、SPSCQueue、FlowController
基础工具 配置、日志、JWT、密码哈希、证书、JSON、ID 和时间处理

快速开始

git clone --recursive https://github.com/AlkaidLab/intertwine-cpp-framework.git
cd intertwine-cpp-framework
./build.sh --test

Windows:

git clone --recursive https://github.com/AlkaidLab/intertwine-cpp-framework.git
Set-Location intertwine-cpp-framework
.\build.ps1 -Test

构建脚本会准备 vcpkg 与 libhv 依赖。可按需要指定 vcpkg 或安装目录:

./build.sh --vcpkg-root ../vcpkg
./build.sh --install-dir ./out/install

使用方式

#include <intertwine/fw/Application.hpp>
#include <intertwine/fw/Context.hpp>
#include <intertwine/fw/Router.hpp>

namespace fw = intertwine::fw;

int main() {
    fw::Application app;
    fw::Router router;

    router.get("/hello", [](fw::Context& ctx) {
        ctx.json(200, "{\"message\":\"hello\"}");
    });

    app.mount(router);
    app.setPort(8080);
    return app.start();
}

CMake 集成

安装框架后,在项目中查找并链接 intertwine_cpp_framework:

find_package(intertwine_cpp_framework REQUIRED)
target_link_libraries(your_target PRIVATE intertwine_cpp_framework)

若安装位置不在 CMake 的默认搜索路径中,配置项目时传入该前缀:

cmake -S . -B build -DCMAKE_PREFIX_PATH=/path/to/framework-install

作为子模块

git submodule add \
  https://github.com/AlkaidLab/intertwine-cpp-framework.git \
  third_party/intertwine-cpp-framework
git submodule update --init --recursive

文档

中文(默认):

  • API 参考
  • 架构说明
  • 模块参考

English:

  • API Reference
  • Architecture
  • Module Guide

依赖

  • libhv
  • Boost
  • OpenSSL
  • spdlog
  • nlohmann/json

依赖由 vcpkg 构建流程解析;测试使用 GTest。

许可证

BSD 3-Clause License

About

C++11 framework for HTTP/HTTPS, TCP, WebSocket, middleware, async tasks, and file transfer.

Topics

cppcpp11http-servermiddlewarewebsocket

Resources

Readme
BSD-3-Clause license
Activity
Custom properties

Stars

2 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.