From 88ada3bc05ea247b6c8a24db49ebfdd268c17f4d Mon Sep 17 00:00:00 2001 From: V-Sanjana Date: Thu, 13 Apr 2023 15:18:31 +0530 Subject: Add Server-Sent-Event support Server-Sent-Event is a standard describing how servers can initiate data transmission towards clients once an initial client connection has been established. Unlike websockets (which are bidirectional), Server-Sent-Events(SSE) are unidirectional and commonly used to send message updates or continuous data streams to a browser client. This is base patch for adding Server-Sent-Events routing support to bmcweb. Redfish EventService SSE style subscription uses SSE route for sending the Events/MetricReports to client which establishes the connection. Tested this patch with along with EventService SSE support patches and verified the functionalty on browser. Tested: - Tested using follow-up patches on top which adds support for Redfish EventService SSE style subscription and observed events are getting sent periodically. - Created SSE subscription from the browser by visiting https:///redfish/v1/EventService/SSE Change-Id: I36956565cbba30c2007852c9471f477f6d1736e9 Signed-off-by: AppaRao Puli Signed-off-by: P Dheeraj Srujan Kumar Signed-off-by: V-Sanjana --- http/http_response.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'http/http_response.hpp') diff --git a/http/http_response.hpp b/http/http_response.hpp index 1a4ef16d4e..06b693915f 100644 --- a/http/http_response.hpp +++ b/http/http_response.hpp @@ -16,10 +16,18 @@ namespace crow template class Connection; +namespace sse_socket +{ +template +class ConnectionImpl; +} // namespace sse_socket + struct Response { template friend class crow::Connection; + template + friend class crow::sse_socket::ConnectionImpl; using response_type = boost::beast::http::response; -- cgit v1.2.3