diff --git a/CMakeLists.txt b/CMakeLists.txt index f58595db6..e56781a2d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1633,6 +1633,7 @@ if (NOT LWS_WITHOUT_TESTAPPS) "${PROJECT_SOURCE_DIR}/test-apps/candide.zip" "${PROJECT_SOURCE_DIR}/test-apps/libwebsockets.org-logo.png" "${PROJECT_SOURCE_DIR}/test-apps/http2.png" + "${PROJECT_SOURCE_DIR}/test-apps/wss-over-h2.png" "${PROJECT_SOURCE_DIR}/test-apps/lws-common.js" "${PROJECT_SOURCE_DIR}/test-apps/test.html") diff --git a/README.md b/README.md index 0d60a88cf..8fa6048fc 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ News ## Lws has the first official ws-over-h2 server support + + There's a new standard on the RFC track that enables multiplexing ws connections over an http/2 link. Compared to making individual tcp and tls connections for each ws link back to the same server, this makes your site start up radically diff --git a/plugins/protocol_lws_status.c b/plugins/protocol_lws_status.c index e456c8bd6..edd534131 100644 --- a/plugins/protocol_lws_status.c +++ b/plugins/protocol_lws_status.c @@ -49,6 +49,7 @@ struct per_session_data__lws_status { struct per_session_data__lws_status *walk_next; unsigned char subsequent:1; unsigned char changed_partway:1; + unsigned char wss_over_h2:1; }; struct per_vhost_data__lws_status { @@ -114,6 +115,8 @@ callback_lws_status(struct lws *wsi, enum lws_callback_reasons reason, pss->next = vhd->live_pss_list; vhd->live_pss_list = pss; + pss->wss_over_h2 = !!len; + time(&pss->time_est); pss->wsi = wsi; strcpy(pss->user_agent, "unknown"); @@ -129,9 +132,11 @@ callback_lws_status(struct lws *wsi, enum lws_callback_reasons reason, n = LWS_WRITE_TEXT | LWS_WRITE_NO_FIN;; p += lws_snprintf(p, end - p, "{ \"version\":\"%s\"," + " \"wss_over_h2\":\"%d\"," " \"hostname\":\"%s\"," " \"wsi\":\"%d\", \"conns\":[", lws_get_library_version(), + pss->wss_over_h2, lws_canonical_hostname(vhd->context), vhd->count_live_pss); pss->walk = WALK_LIST; diff --git a/test-apps/http2.png b/test-apps/http2.png index 439bfa482..b4129e73b 100644 Binary files a/test-apps/http2.png and b/test-apps/http2.png differ diff --git a/test-apps/test-server-libuv.c b/test-apps/test-server-libuv.c index e229c0322..5aecfa64f 100644 --- a/test-apps/test-server-libuv.c +++ b/test-apps/test-server-libuv.c @@ -346,7 +346,7 @@ int main(int argc, char **argv) } info.gid = -1; info.uid = -1; - info.max_http_header_pool = 1; + info.max_http_header_pool = 16; info.timeout_secs = 5; info.options = opts | LWS_SERVER_OPTION_LIBUV; diff --git a/test-apps/test.html b/test-apps/test.html index a3fb3fcd8..786ced01f 100644 --- a/test-apps/test.html +++ b/test-apps/test.html @@ -6,7 +6,7 @@