THRIFT-5185: Support for using WebSockets as a server transport
Client: cpp
diff --git a/test/cpp/src/TestServer.cpp b/test/cpp/src/TestServer.cpp
index 8fdab86..65317f8 100644
--- a/test/cpp/src/TestServer.cpp
+++ b/test/cpp/src/TestServer.cpp
@@ -39,6 +39,7 @@
#include <thrift/transport/TSSLSocket.h>
#include <thrift/transport/TServerSocket.h>
#include <thrift/transport/TTransportUtils.h>
+#include <thrift/transport/TWebSocketServer.h>
#include <thrift/transport/TZlibTransport.h>
#include "SecondService.h"
@@ -588,7 +589,7 @@
("domain-socket", po::value<string>(&domain_socket) ->default_value(domain_socket), "Unix Domain Socket (e.g. /tmp/ThriftTest.thrift)")
("abstract-namespace", "Create the domain socket in the Abstract Namespace (no connection with filesystem pathnames)")
("server-type", po::value<string>(&server_type)->default_value(server_type), "type of server, \"simple\", \"thread-pool\", \"threaded\", or \"nonblocking\"")
- ("transport", po::value<string>(&transport_type)->default_value(transport_type), "transport: buffered, framed, http, zlib")
+ ("transport", po::value<string>(&transport_type)->default_value(transport_type), "transport: buffered, framed, http, websocket, zlib")
("protocol", po::value<string>(&protocol_type)->default_value(protocol_type), "protocol: binary, compact, header, json, multi, multic, multih, multij")
("ssl", "Encrypted Transport using SSL")
("zlib", "Wrapped Transport using Zlib")
@@ -635,6 +636,7 @@
if (transport_type == "buffered") {
} else if (transport_type == "framed") {
} else if (transport_type == "http") {
+ } else if (transport_type == "websocket") {
} else if (transport_type == "zlib") {
// crosstester will pass zlib as a flag and a transport right now...
} else {
@@ -728,6 +730,12 @@
if (transport_type == "http" && server_type != "nonblocking") {
transportFactory = std::make_shared<THttpServerTransportFactory>();
+ } else if (transport_type == "websocket" && server_type != "nonblocking") {
+ if (protocol_type == "json" || protocol_type == "multij") {
+ transportFactory = std::make_shared<TTextWebSocketServerTransportFactory>();
+ } else {
+ transportFactory = std::make_shared<TBinaryWebSocketServerTransportFactory>();
+ }
} else if (transport_type == "framed") {
transportFactory = std::make_shared<TFramedTransportFactory>();
} else {
diff --git a/test/known_failures_Linux.json b/test/known_failures_Linux.json
index 49ec222..5b78803 100644
--- a/test/known_failures_Linux.json
+++ b/test/known_failures_Linux.json
@@ -21,6 +21,42 @@
"cl-rs_multi-binary_framed-ip",
"cl-rs_multi_buffered-ip",
"cl-rs_multi_framed-ip",
+ "cpp-cpp_binary_websocket-domain",
+ "cpp-cpp_binary_websocket-ip",
+ "cpp-cpp_binary_websocket-ip-ssl",
+ "cpp-cpp_compact_websocket-domain",
+ "cpp-cpp_compact_websocket-ip",
+ "cpp-cpp_compact_websocket-ip-ssl",
+ "cpp-cpp_header_websocket-domain",
+ "cpp-cpp_header_websocket-ip",
+ "cpp-cpp_header_websocket-ip-ssl",
+ "cpp-cpp_json_websocket-domain",
+ "cpp-cpp_json_websocket-ip",
+ "cpp-cpp_json_websocket-ip-ssl",
+ "cpp-cpp_multi-binary_websocket-domain",
+ "cpp-cpp_multi-binary_websocket-ip",
+ "cpp-cpp_multi-binary_websocket-ip-ssl",
+ "cpp-cpp_multi_websocket-domain",
+ "cpp-cpp_multi_websocket-ip",
+ "cpp-cpp_multi_websocket-ip-ssl",
+ "cpp-cpp_multic-compact_websocket-domain",
+ "cpp-cpp_multic-compact_websocket-ip",
+ "cpp-cpp_multic-compact_websocket-ip-ssl",
+ "cpp-cpp_multic_websocket-domain",
+ "cpp-cpp_multic_websocket-ip",
+ "cpp-cpp_multic_websocket-ip-ssl",
+ "cpp-cpp_multih-header_websocket-domain",
+ "cpp-cpp_multih-header_websocket-ip",
+ "cpp-cpp_multih-header_websocket-ip-ssl",
+ "cpp-cpp_multih_websocket-domain",
+ "cpp-cpp_multih_websocket-ip",
+ "cpp-cpp_multih_websocket-ip-ssl",
+ "cpp-cpp_multij-json_websocket-domain",
+ "cpp-cpp_multij-json_websocket-ip",
+ "cpp-cpp_multij-json_websocket-ip-ssl",
+ "cpp-cpp_multij_websocket-domain",
+ "cpp-cpp_multij_websocket-ip",
+ "cpp-cpp_multij_websocket-ip-ssl",
"cpp-dart_binary_http-ip",
"cpp-dart_compact_http-ip",
"cpp-dart_json_http-ip",
@@ -72,27 +108,39 @@
"cpp-nodejs_binary_http-domain",
"cpp-nodejs_binary_http-ip",
"cpp-nodejs_binary_http-ip-ssl",
+ "cpp-nodejs_binary_websocket-domain",
"cpp-nodejs_compact_http-domain",
"cpp-nodejs_compact_http-ip",
"cpp-nodejs_compact_http-ip-ssl",
+ "cpp-nodejs_compact_websocket-domain",
"cpp-nodejs_header_http-domain",
"cpp-nodejs_header_http-ip",
"cpp-nodejs_header_http-ip-ssl",
+ "cpp-nodejs_header_websocket-domain",
+ "cpp-nodejs_header_websocket-ip",
+ "cpp-nodejs_header_websocket-ip-ssl",
"cpp-nodejs_json_http-domain",
"cpp-nodejs_json_http-ip",
"cpp-nodejs_json_http-ip-ssl",
+ "cpp-nodejs_json_websocket-domain",
"cpp-nodejs_multi-binary_http-domain",
"cpp-nodejs_multi-binary_http-ip",
"cpp-nodejs_multi-binary_http-ip-ssl",
+ "cpp-nodejs_multi-binary_websocket-domain",
"cpp-nodejs_multic-compact_http-domain",
"cpp-nodejs_multic-compact_http-ip",
"cpp-nodejs_multic-compact_http-ip-ssl",
+ "cpp-nodejs_multic-compact_websocket-domain",
"cpp-nodejs_multih-header_http-domain",
"cpp-nodejs_multih-header_http-ip",
"cpp-nodejs_multih-header_http-ip-ssl",
+ "cpp-nodejs_multih-header_websocket-domain",
+ "cpp-nodejs_multih-header_websocket-ip",
+ "cpp-nodejs_multih-header_websocket-ip-ssl",
"cpp-nodejs_multij-json_http-domain",
"cpp-nodejs_multij-json_http-ip",
"cpp-nodejs_multij-json_http-ip-ssl",
+ "cpp-nodejs_multij-json_websocket-domain",
"cpp-php_binary-accel_buffered-ip",
"cpp-php_binary-accel_framed-ip",
"cpp-php_json_buffered-ip",
@@ -500,16 +548,28 @@
"nodejs-cpp_binary_http-domain",
"nodejs-cpp_binary_http-ip",
"nodejs-cpp_binary_http-ip-ssl",
+ "nodejs-cpp_binary_websocket-domain",
+ "nodejs-cpp_binary_websocket-ip",
+ "nodejs-cpp_binary_websocket-ip-ssl",
"nodejs-cpp_compact_http-domain",
"nodejs-cpp_compact_http-ip",
"nodejs-cpp_compact_http-ip-ssl",
+ "nodejs-cpp_compact_websocket-domain",
+ "nodejs-cpp_compact_websocket-ip",
+ "nodejs-cpp_compact_websocket-ip-ssl",
"nodejs-cpp_header_http-domain",
"nodejs-cpp_header_http-ip",
"nodejs-cpp_header_http-ip-ssl",
+ "nodejs-cpp_header_websocket-domain",
+ "nodejs-cpp_header_websocket-ip",
+ "nodejs-cpp_header_websocket-ip-ssl",
"nodejs-cpp_json_buffered-ip-ssl",
"nodejs-cpp_json_http-domain",
"nodejs-cpp_json_http-ip",
"nodejs-cpp_json_http-ip-ssl",
+ "nodejs-cpp_json_websocket-domain",
+ "nodejs-cpp_json_websocket-ip",
+ "nodejs-cpp_json_websocket-ip-ssl",
"nodejs-d_binary_http-ip",
"nodejs-d_binary_http-ip-ssl",
"nodejs-d_compact_http-ip",
@@ -549,6 +609,10 @@
"nodejs-netstd_json_buffered-ip-ssl",
"nodejs-netstd_json_framed-ip",
"nodejs-netstd_json_framed-ip-ssl",
+ "nodejs-nodejs_binary_websocket-domain",
+ "nodejs-nodejs_compact_websocket-domain",
+ "nodejs-nodejs_header_websocket-domain",
+ "nodejs-nodejs_json_websocket-domain",
"nodejs-php_binary-accel_buffered-ip",
"nodejs-php_binary-accel_framed-ip",
"nodejs-php_json_buffered-ip",
diff --git a/test/tests.json b/test/tests.json
index 42e5d6a..a8dbef7 100644
--- a/test/tests.json
+++ b/test/tests.json
@@ -193,7 +193,8 @@
"transports": [
"buffered",
"framed",
- "http"
+ "http",
+ "websocket"
],
"sockets": [
"ip",
@@ -366,7 +367,8 @@
"buffered",
"http",
"framed",
- "zlib"
+ "zlib",
+ "websocket"
],
"sockets": [
"ip",