Rebuild libwebsockets for Mac with server feature

Rebuild libwebsockets for Mac with server feature
0.0 0

#1

I want to rebuild libwebsocets,
I fallow this topic: http://carlgira-ot.blogspot.tw/2016/11/websocketserver-cocos2djs-part-1.html
and clone the cocos2d-x 3rd party libs from: https://github.com/cocos2d/cocos2d-x-3rd-party-libs-src
type “./build.sh --platform=mac --libs=websockets” in terminator
I got this error:


/Users/joey/Downloads/cocos2d-x-3rd-party-libs-src-3/contrib/mac-x86_64/websockets/lib/server.c:113:27: error:
use of undeclared identifier ‘SOL_IPV6’
if (setsockopt(sockfd, SOL_IPV6, IPV6_V6ONLY,
^
1 error generated.
make[3]: *** [CMakeFiles/websockets.dir/lib/server.c.o] Error 1
make[2]: *** [CMakeFiles/websockets.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [.websockets] Error 2


How to solve it ?


#2

I change rules.mak,
remove IPV6 setting,
let -DLWS_IPV6=0,
now, it’s work.

But anyone knows how to implement a server with ssl?(wss://)