This is a performance-oriented implementation of WebSocket. Strive for lowest latency and high throughput.
Our library supports DPDK (Data Plane Development Kit, a kernel-bypass network library).
We abstracted the TCP layer once. Various implementations are available for TCP. Currently we have implemented F-Stack (TCP/IP network library based on DPDK) and POSIX API (including epoll in Linux). Even if you don't have DPDK, you can still enjoy the high performance we provide.
Technologies including Zero Copy, Huge Page, SIMD, etc. are used to optimize our implementation.
Our current implementation is based on F-Stack to obtain the TCP/IP protocol stack. So you need to install F-Stack and DPDK beforehand, unless you want to use POSIX implementation (and then some advantages are gone). See the website of F-Stack for details.
Also, currently we need openssl or boringssl. If you use dpdk, openssl need to be linked to it.
This is a head-only library, all you need is the installation of dependencies and properly include this code directory.
After you have installed the dependent libraries,
git clone https://github.com/renzibei/flashws
cd flashws
git submodule update --init --recursive
Then you can compile the tests and examples.
cd tests
mkdir build
cd build
cmake .. [-DFWS_ENABLE_FSTACK=OFF/ON]
make -j6
You can take a look at the benchmark ws-benchmark.