Rebuild libwebsockets for Mac with server feature


I want to rebuild libwebsocets,
I fallow this topic:
and clone the cocos2d-x 3rd party libs from:
type “./ --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 ?


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://)