From 478e9f340fe303f3171f4184f494947bf39e3dbf Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Tue, 10 Jan 2023 20:14:48 +0100 Subject: Forwarding subprotocol and target to target websocket --- response.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'response.cpp') diff --git a/response.cpp b/response.cpp index eeda8d0..ed30550 100644 --- a/response.cpp +++ b/response.cpp @@ -40,7 +40,7 @@ public: { } - // GetTarget() == GetPluginPath() + GetRelativePath() + // GetTarget() == GetPluginPath() + "/" + GetRelativePath() const Path& GetPath() const {return m_path;} // GetPluginPath w/ configured params as struct @@ -337,19 +337,14 @@ response_type response::generate_response(request_type& req, Server& server) std::string response::get_websocket_address(request_type& req, Server& server) { try { - std::cout << "DEBUG0" << std::endl; - std::cout << "DEBUG0: " << req.target() << std::endl; RequestContext req_ctx{req, server}; // can throw std::out_of_range - std::cout << "DEBUG1" << std::endl; if (req_ctx.GetPluginName() != "websocket") { std::cout << "Bad plugin configured for websocket request: " << req_ctx.GetPluginName() << std::endl; return {}; } - std::cout << "DEBUG2" << std::endl; - return req_ctx.GetDocRoot(); // Configured "path" in config: host:port for websocket - std::cout << "DEBUG3" << std::endl; + return req_ctx.GetDocRoot() + "/" + req_ctx.GetRelativePath(); // Configured "path" in config: host:port/relative_path for websocket } catch (const std::exception& ex) { std::cout << "No matching configured target websocket found: " << ex.what() << std::endl; -- cgit v1.2.3