Build a high-performance HTTP or WebSocket server in C++ using the coroutine-based IO scheduler.
Use the hook module to make blocking third-party libraries like MySQL clients work in an async coroutine environment.
Learn how to build a server framework from scratch by following the companion Bilibili tutorial series.
Set up YAML-based configuration that automatically notifies your app components when settings change.
Linux-only due to epoll dependency, requires C++ build toolchain and familiarity with Chinese-language documentation.
Sylar is a C++ framework for building high-performance networked server applications, including web servers and WebSocket servers. It was created alongside a Chinese-language video tutorial series on Bilibili aimed at teaching people how to build a server framework from scratch. The README is written in Chinese. The framework is organized into a collection of modules that each handle a specific concern. The logging module supports two styles of writing log messages, lets you customize the log format, set log levels, and route different logs to different destinations. The configuration module reads settings from YAML files and automatically notifies parts of the application when a setting changes, so you do not need to manually reload values. At its core, the framework uses coroutines, which are a way to write code that looks sequential but can pause and resume to handle multiple tasks at once without the overhead of creating many operating system threads. The coroutine scheduler manages groups of coroutines across a configurable pool of threads. Built on top of that, the IO coroutine scheduler uses Linux's epoll system to handle network reads and writes efficiently, and it also provides timers with millisecond precision. A hook module intercepts low-level socket and sleep system calls so that libraries or code that was not written for async use (like MySQL client libraries) can still benefit from the coroutine-based async model without any changes to that code. The framework includes modules for TCP servers, HTTP/1.1 parsing and serving, WebSocket, HTTPS, a servlet system modeled after Java's servlet pattern, binary serialization, and support for MySQL, SQLite3, Redis, Zookeeper, and a basic ORM layer. Contact information for the author, including a QQ number and personal website, is listed at the bottom of the README.
← sylar-yin on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.