Reimplementd IX with OpenSSL
This commit is contained in:
1 parent
5e80c41538
commit
71656e4a66
214 files changed
+44919
-99
No files matched your search
@@ -0,0 +1,42 @@
|
||||
#ifndef GERMANAIRLINESVA_GACONNECTOR_WEBSOCKET_H
|
||||
#define GERMANAIRLINESVA_GACONNECTOR_WEBSOCKET_H
|
||||
|
||||
#define BUFSIZE 1024
|
||||
#define MD5LEN 16
|
||||
|
||||
#include <IXNetSystem.h>
|
||||
#include <IXWebSocketServer.h>
|
||||
|
||||
#include <json.hpp>
|
||||
|
||||
#include "types.h"
|
||||
#include "util.hpp"
|
||||
|
||||
#include <cstring>
|
||||
#include <functional>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
class Websocket
|
||||
{
|
||||
private:
|
||||
char lastPath[513] = "";
|
||||
char lastHash[2 * MD5LEN + 1] = "";
|
||||
ix::WebSocket *webSocket = nullptr;
|
||||
std::mutex wsLock;
|
||||
std::string host;
|
||||
std::string user;
|
||||
std::function<void(std::string)> toLog;
|
||||
|
||||
public:
|
||||
explicit Websocket(std::string host,
|
||||
std::string user,
|
||||
std::function<void(const std::string)> toLog);
|
||||
~Websocket();
|
||||
void onClientMessageCallback(const ix::WebSocketMessagePtr &msg);
|
||||
void sendData(data d);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user