diff options
author | V-Sanjana <sanjana.v@intel.com> | 2023-04-13 12:48:31 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2023-06-01 23:43:11 +0300 |
commit | 88ada3bc05ea247b6c8a24db49ebfdd268c17f4d (patch) | |
tree | f9dc4aa1415ea50a7d62c348b1118e307eb11b6a /http/http_response.hpp | |
parent | 600af5f1ee6f3a589d5c1a7be31579ca705eef71 (diff) | |
download | bmcweb-88ada3bc05ea247b6c8a24db49ebfdd268c17f4d.tar.xz |
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://<BMC IP>/redfish/v1/EventService/SSE
Change-Id: I36956565cbba30c2007852c9471f477f6d1736e9
Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
Signed-off-by: P Dheeraj Srujan Kumar <p.dheeraj.srujan.kumar@intel.com>
Signed-off-by: V-Sanjana <sanjana.v@intel.com>
Diffstat (limited to 'http/http_response.hpp')
-rw-r--r-- | http/http_response.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
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 <typename Adaptor, typename Handler> class Connection; +namespace sse_socket +{ +template <typename Adaptor> +class ConnectionImpl; +} // namespace sse_socket + struct Response { template <typename Adaptor, typename Handler> friend class crow::Connection; + template <typename Adaptor> + friend class crow::sse_socket::ConnectionImpl; using response_type = boost::beast::http::response<boost::beast::http::string_body>; |