From 3e8db7cd243e8be3b2d5fea2490b9ad70f765590 Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Wed, 4 Oct 2023 13:13:23 +0200 Subject: removed websocket protocol support(#445) removed websocket support since it is not used right now and is unlikely to be used in the future --- src/zenhttp/testing/httptest.cpp | 32 -------------------------------- 1 file changed, 32 deletions(-) (limited to 'src/zenhttp/testing/httptest.cpp') diff --git a/src/zenhttp/testing/httptest.cpp b/src/zenhttp/testing/httptest.cpp index a02e36bcc..3a0ad72a9 100644 --- a/src/zenhttp/testing/httptest.cpp +++ b/src/zenhttp/testing/httptest.cpp @@ -140,38 +140,6 @@ HttpTestingService::HandlePackageRequest(HttpServerRequest& HttpServiceRequest) return (InsertResult.first->second = Ref(new PackageHandler(*this, RequestId))); } -void -HttpTestingService::RegisterHandlers(WebSocketServer& Server) -{ - Server.RegisterRequestHandler("SayHello"sv, *this); -} - -bool -HttpTestingService::HandleRequest(const WebSocketMessage& RequestMsg) -{ - CbObjectView Request = RequestMsg.Body().GetObject(); - - std::string_view Method = Request["Method"].AsString(); - - if (Method != "SayHello"sv) - { - return false; - } - - CbObjectWriter Response; - Response.AddString("Result"sv, "Hello Friend!!"); - - WebSocketMessage ResponseMsg; - ResponseMsg.SetMessageType(WebSocketMessageType::kResponse); - ResponseMsg.SetCorrelationId(RequestMsg.CorrelationId()); - ResponseMsg.SetSocketId(RequestMsg.SocketId()); - ResponseMsg.SetBody(Response.Save()); - - SocketServer().SendResponse(std::move(ResponseMsg)); - - return true; -} - ////////////////////////////////////////////////////////////////////////// HttpTestingService::PackageHandler::PackageHandler(HttpTestingService& Svc, uint32_t RequestId) : m_Svc(Svc), m_RequestId(RequestId) -- cgit v1.2.3