MCPcopy Create free account
hub / github.com/chronoxor/CppServer / HTTPSTraceSession

Class HTTPSTraceSession

performance/https_trace_server.cpp:17–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15using namespace CppServer::HTTP;
16
17class HTTPSTraceSession : public HTTPSSession
18{
19public:
20 using HTTPSSession::HTTPSSession;
21
22protected:
23 void onReceivedRequest(const HTTPRequest& request) override
24 {
25 // Process HTTP request methods
26 if (request.method() == "TRACE")
27 SendResponseAsync(response().MakeTraceResponse(request.cache()));
28 else
29 SendResponseAsync(response().MakeErrorResponse("Unsupported HTTP method: " + std::string(request.method())));
30 }
31
32 void onReceivedRequestError(const HTTPRequest& request, const std::string& error) override
33 {
34 std::cout << "Request error: " << error << std::endl;
35 }
36
37 void onError(int error, const std::string& category, const std::string& message) override
38 {
39 std::cout << "HTTPS Trace session caught an error with code " << error << " and category '" << category << "': " << message << std::endl;
40 }
41};
42
43class HTTPSTraceServer : public HTTPSServer
44{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected