1
0
mirror of https://github.com/0O0o0oOoO00/Alas.git synced 2026-05-15 07:29:26 +08:00
Files
Alas/blcrack/cracker/server.hpp
2025-05-26 20:30:35 +08:00

41 lines
699 B
C++

#ifndef SERVER_HPP
#define SERVER_HPP
#include <httplib.h>
#include <map>
#include <vector>
#include <string>
class CrackerServer: public httplib::Server {
public:
struct WebPage {
std::string type;
std::vector<unsigned char> content;
};
CrackerServer();
~CrackerServer() override = default;
static void Start();
static std::map<
std::string,
WebPage
> WebRes;
private:
void set_web_page();
class WebPageResponder {
public:
WebPageResponder(WebPage& page);
void operator()(const httplib::Request& req, httplib::Response& res) const;
private:
WebPage& m_page;
};
};
#endif //SERVER_HPP