Remove psychichttp
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
#ifndef Socket_h
|
||||
#define Socket_h
|
||||
|
||||
#include <PsychicHttp.h>
|
||||
#include <esp_http_server.h>
|
||||
#include <template/stateful_service.h>
|
||||
#include <utils/websocket_server.h>
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
@@ -12,7 +13,7 @@
|
||||
|
||||
class Websocket : CommAdapterBase {
|
||||
public:
|
||||
Websocket(PsychicHttpServer &server, const char *route = "/api/ws");
|
||||
Websocket(httpd_handle_t *server, const char *route = "/api/ws");
|
||||
|
||||
void begin() override;
|
||||
|
||||
@@ -20,17 +21,21 @@ class Websocket : CommAdapterBase {
|
||||
|
||||
void emit(const char *event, JsonVariant &payload, const char *originId = "", bool onlyToSameOrigin = false);
|
||||
|
||||
private:
|
||||
PsychicWebSocketHandler _socket;
|
||||
PsychicHttpServer &_server;
|
||||
const char *_route;
|
||||
httpd_uri_t *getUriHandler() { return &_ws_uri; }
|
||||
|
||||
void onWSOpen(PsychicWebSocketClient *client);
|
||||
void onWSClose(PsychicWebSocketClient *client);
|
||||
esp_err_t onFrame(PsychicWebSocketRequest *request, httpd_ws_frame *frame);
|
||||
private:
|
||||
websocket::WebSocketServer _socket;
|
||||
httpd_handle_t *_server;
|
||||
const char *_route;
|
||||
httpd_uri_t _ws_uri;
|
||||
|
||||
void onWSOpen(int fd);
|
||||
void onWSClose(int fd);
|
||||
esp_err_t onFrame(httpd_req_t *req, httpd_ws_frame_t *frame);
|
||||
|
||||
void send(const uint8_t *data, size_t len, int cid = -1) override;
|
||||
|
||||
static esp_err_t ws_handler_wrapper(httpd_req_t *req);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user