28 lines
700 B
C++
Executable File
28 lines
700 B
C++
Executable File
//
|
|
// Created by Ilya on 16.10.2022.
|
|
//
|
|
|
|
#ifndef UNTITLED_CONNECTION_H
|
|
#define UNTITLED_CONNECTION_H
|
|
#include "string"
|
|
#include <websocketpp/client.hpp>
|
|
#include <websocketpp/config/asio_client.hpp>
|
|
#include <nlohmann/json.hpp>
|
|
|
|
typedef websocketpp::client<websocketpp::config::asio_tls_client> client;
|
|
typedef websocketpp::lib::shared_ptr<boost::asio::ssl::context> context_ptr;
|
|
|
|
class connection {
|
|
private:
|
|
std::string session;
|
|
client ws;
|
|
|
|
public:
|
|
explicit connection(std::string session);
|
|
void on_message(websocketpp::connection_hdl, client::message_ptr msg);
|
|
context_ptr on_tls_init(websocketpp::connection_hdl);
|
|
};
|
|
|
|
|
|
#endif //UNTITLED_CONNECTION_H
|