diff options
Diffstat (limited to 'xmrstak/http/httpd.hpp')
-rw-r--r-- | xmrstak/http/httpd.hpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/xmrstak/http/httpd.hpp b/xmrstak/http/httpd.hpp new file mode 100644 index 0000000..bc8bcf6 --- /dev/null +++ b/xmrstak/http/httpd.hpp @@ -0,0 +1,31 @@ +#pragma once + +struct MHD_Daemon; +struct MHD_Connection; + +class httpd +{ +public: + static httpd* inst() + { + if (oInst == nullptr) oInst = new httpd; + return oInst; + }; + + bool start_daemon(); + +private: + httpd(); + static httpd* oInst; + + static int req_handler(void * cls, + MHD_Connection* connection, + const char* url, + const char* method, + const char* version, + const char* upload_data, + size_t* upload_data_size, + void ** ptr); + + MHD_Daemon *d; +}; |