diff --git a/CMakeLists.txt b/CMakeLists.txt index e42de5fb..92546b7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -98,11 +98,15 @@ if(APPLE) option(ZMQ_BUILD_FRAMEWORK "Build as OS X framework" OFF) endif() -# Disable webSocket transport -option(DISABLE_WS "Disable WebSocket transport" OFF) +# Enable webSocket transport +if (ENABLE_DRAFTS) + option(ENABLE_WS "Enable WebSocket transport" ON) +else() + option(ENABLE_WS "Enable WebSocket transport" OFF) +endif() option(WITH_NSS "Use NSS instead of builtin sha1" OFF) -if (NOT DISABLE_WS) +if (ENABLE_WS) list(APPEND sources ${CMAKE_CURRENT_SOURCE_DIR}/src/ws_address.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/wss_address.cpp diff --git a/NEWS b/NEWS index 960a9408..c4673acb 100644 --- a/NEWS +++ b/NEWS @@ -27,7 +27,7 @@ of WebSockets (and secure WebSockets via TLS) via the ZWS 2.0 protocol. WSS requires the GnuTLS library for TLS support. ZMQ_WSS_ specific socket options were added to support TLS. - WebSockets support can be disabled at build time with --disable-ws. + WebSockets support is disabled by default if DRAFT APIs are disabled. * Fixed #3566 - malformed CURVE message can cause memory leak diff --git a/configure.ac b/configure.ac index 8ac65888..aa532a77 100644 --- a/configure.ac +++ b/configure.ac @@ -565,7 +565,9 @@ AM_CONDITIONAL(USE_WEPOLL, test "$poller" = "wepoll") ws_crypto_library="" AC_ARG_ENABLE([ws], - [AS_HELP_STRING([--disable-ws], [Disable WebSocket transport [default=no]])]) + [AS_HELP_STRING([--enable-ws], [Enable WebSocket transport [default=state of DRAFT]])], + [enable_ws=$enableval], + [enable_ws=$enable_drafts]) AC_ARG_WITH([nss], [AS_HELP_STRING([--with-nss], [use nss instead of built-in sha1 [default=no]])])