| 70 | } |
| 71 | |
| 72 | choc::network::HTTPContent getHTTPContent (std::string_view path) override |
| 73 | { |
| 74 | // This path is asking for the default page content |
| 75 | if (path == "/") |
| 76 | { |
| 77 | // When we return the content for the page, we'll embed the URL into it that |
| 78 | // it'll need to use to open the websocket back to this address.. |
| 79 | auto pageContent = choc::text::replace (demoPageHTML, |
| 80 | "SOCKET_URL", choc::json::getEscapedQuotedString (server.getWebSocketAddress())); |
| 81 | |
| 82 | return choc::network::HTTPContent::forHTML (pageContent); |
| 83 | } |
| 84 | |
| 85 | // If you want to serve content for other paths, you would do that here... |
| 86 | |
| 87 | return {}; |
| 88 | } |
| 89 | |
| 90 | void upgradedToWebSocket (std::string_view path) override |
| 91 | { |
nothing calls this directly
no test coverage detected