From 40dc13f0bde10f8745bf4386e34e442ff0340b81 Mon Sep 17 00:00:00 2001 From: antao Date: Fri, 5 Apr 2019 09:54:26 +0800 Subject: [PATCH 1/2] Add ws_test.html for websocket testing --- examples/simple_example_test/ws_test.html | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 examples/simple_example_test/ws_test.html diff --git a/examples/simple_example_test/ws_test.html b/examples/simple_example_test/ws_test.html new file mode 100644 index 00000000..59fd9745 --- /dev/null +++ b/examples/simple_example_test/ws_test.html @@ -0,0 +1,23 @@ + +

+

From d2bb1c10a754c2503da980fdbdda47e387d70c72 Mon Sep 17 00:00:00 2001
From: antao 
Date: Fri, 5 Apr 2019 11:36:04 +0800
Subject: [PATCH 2/2] Fix a websocket issue in Linux

---
 lib/src/HttpAppFrameworkImpl.cc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/src/HttpAppFrameworkImpl.cc b/lib/src/HttpAppFrameworkImpl.cc
index b04c74de..38bb5397 100755
--- a/lib/src/HttpAppFrameworkImpl.cc
+++ b/lib/src/HttpAppFrameworkImpl.cc
@@ -318,6 +318,9 @@ void HttpAppFrameworkImpl::run()
 #endif
             }
             serverPtr->setHttpAsyncCallback(std::bind(&HttpAppFrameworkImpl::onAsyncRequest, this, _1, _2));
+            serverPtr->setNewWebsocketCallback(std::bind(&HttpAppFrameworkImpl::onNewWebsockRequest, this, _1, _2, _3));
+            serverPtr->setWebsocketMessageCallback(std::bind(&HttpAppFrameworkImpl::onWebsockMessage, this, _1, _2));
+            serverPtr->setDisconnectWebsocketCallback(std::bind(&HttpAppFrameworkImpl::onWebsockDisconnect, this, _1));
             serverPtr->setConnectionCallback(std::bind(&HttpAppFrameworkImpl::onConnection, this, _1));
             serverPtr->kickoffIdleConnections(_idleConnectionTimeout);
             serverPtr->start();