Hook up WebSocket parsers somewhat

This commit is contained in:
Alex Hultman
2018-08-30 01:14:34 +02:00
parent f281ab2c96
commit ffdfc8274f
7 changed files with 487 additions and 17 deletions
+4
View File
@@ -7,6 +7,7 @@
#include "HttpSocket.h"
#include "HttpRouter.h"
#include "libwshandshake.hpp"
#include "WebSocket.h"
namespace uWS {
@@ -76,6 +77,9 @@ protected:
static_dispatch(us_ssl_socket_context_on_data, us_socket_context_on_data)(webSocketServerContext, [](auto *s, char *data, int length) {
WebSocketServerContextData *webSocketServerContextData = (WebSocketServerContextData *) static_dispatch(us_ssl_socket_context_ext, us_socket_context_ext)(static_dispatch(us_ssl_socket_get_context, us_socket_get_context)(s));
((WebSocket<SSL, true> *) s)->onData(data, length/*, webSocketServerContextData->onMessage*/);
// this is set via the setter?
webSocketServerContextData->onMessage((HttpSocket<SSL> *) s, std::string_view(data, length));