Added API authorization via Bearer token.

This commit is contained in:
XMRig 2017-09-02 08:18:24 +03:00
parent 7798f09dc7
commit 325e116624
3 changed files with 55 additions and 16 deletions

View file

@ -28,8 +28,9 @@
#include <uv.h>
struct MHD_Daemon;
struct MHD_Connection;
struct MHD_Daemon;
struct MHD_Response;
class Httpd
@ -39,7 +40,10 @@ public:
bool start();
private:
static int handler(void *cls, struct MHD_Connection *connection, const char *url, const char *method, const char *version, const char *upload_data, size_t *upload_data_size, void **con_cls);
int auth(const char *header);
static int done(MHD_Connection *connection, int status, MHD_Response *rsp);
static int 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 **con_cls);
const char *m_accessToken;
const int m_port;