| 1234567891011121314151617181920212223242526272829303132333435363738 |
- #ifndef __HTTPSERVER_H__
- #define __HTTPSERVER_H__
- #include <QObject>
- #include <httplib.h>
- #include <stdint.h>
- #include <QThread>
- class HttpServer : public QObject
- {
- Q_OBJECT
- public:
- explicit HttpServer(QObject *parent = nullptr);
- ~HttpServer();
- std::string addr() const;
- uint16_t port() const;
- bool isRunning() const;
- void run(const char *addr, unsigned short port);
- void stop();
- private:
- std::string m_addr;
- uint16_t m_port;
- httplib::Server m_server;
- QThread m_thread;
- signals:
- void monitorConfigureUpdate(const QString &filename);
- void reloadCanvas();
- private slots:
- void run_hhttp_sever();
- };
- #endif // HTTPSERVER_H
|