diff options
author | Roland Reichwein <mail@reichwein.it> | 2023-01-10 20:14:48 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2023-01-10 20:14:48 +0100 |
commit | 478e9f340fe303f3171f4184f494947bf39e3dbf (patch) | |
tree | 79d80ef1b0ebc3fe0d667db7c2d80c246fddaa5c /response.cpp | |
parent | d02a29f0ff33279268e675aae0856f3f8cf9d939 (diff) |
Forwarding subprotocol and target to target websocket
Diffstat (limited to 'response.cpp')
-rw-r--r-- | response.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
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; |