编译
# 下载最新代码
git clone https://github.com/warmcat/libwebsockets.git --branch v3.2.1
# 在源码目录下创建build目录
cd libwebsockets && mkdir build
cd build
# 构建
OPENSSL_ROOT_DIR=/usr/local/opt/openssl/ PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig cmake -DLWS_MAX_SMP=1 -DCMAKE_INSTALL_PREFIX:PATH=/usr/local -DCMAKE_C_FLAGS="-fpic" ..
# 构建完成,会在build目录下生成Makefile
make && make install