libwebsockets 编译运行测试

获取libsockets源码:

git clone https://github.com/warmcat/libwebsockets.git


编译:

cmake .

make


编译服务器端:

gcc -o test-server test-server-echogen.c test-server.c -I../ -DINSTALL_DATADIR=\"/usr/share\"  -lwebsockets -L../lib test-server-http.c -lssl -lcrypto test-server-dumb-increment.c test-server-mirror.c test-server-status.c


http://killeraction.iteye.com/blog/858325

生成证书对:

openssl genrsa -out libwebsockets-test-server.key.pem 2048

openssl req -new -x509 -key libwebsockets-test-server.key.pem -out libwebsockets-test-server.pem -days 1095





编译echo服务器程序:

gcc -Wall -Werror -fvisibility=hidden  -pthread -O3 -DNDEBUG -I../ -I../lib   -DINSTALL_DATADIR=\"/usr/local/share\"  test-echo.c -o echo -L../ -lwebsockets



你可能感兴趣的:(websockets)