-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhttpd.h
45 lines (37 loc) · 837 Bytes
/
httpd.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef HTTPSD_H
#define HTTPSD_H
#include <QObject>
#ifdef CPPHTTPLIB_OPENSSL_SUPPORT
#define SSL_SERVER 1
#else
#define SSL_SERVER 0
#endif
namespace httplib
{
class Server;
#if SSL_SERVER
class SSLServer;
#endif
}
class HttpD : public QObject
{
Q_OBJECT
public:
#if SSL_SERVER
explicit HttpD(QString szRootPath, quint16 u16Port, quint16 u16sslPort, QObject *parent = nullptr);
#else
explicit HttpD(QString szRootPath, quint16 u16Port, QObject *parent = nullptr);
#endif
public slots:
void start();
void stop();
private:
QString m_szRootPath;
#if SSL_SERVER
httplib::SSLServer *m_httpsServer;
quint16 m_u16HttpsServerBindPort;
#endif
httplib::Server *m_httpServer;
quint16 m_u16HttpServerBindPort;
};
#endif // HTTPSD_H