mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
44 lines
754 B
C++
44 lines
754 B
C++
#ifndef __WSDOOR__
|
|
#define __WSDOOR__
|
|
|
|
#include <boost/asio.hpp>
|
|
#include <boost/asio/ssl.hpp>
|
|
#include <boost/enable_shared_from_this.hpp>
|
|
#include <boost/shared_ptr.hpp>
|
|
#include <boost/thread.hpp>
|
|
|
|
#ifndef WSDOOR_CPP
|
|
|
|
namespace websocketpp
|
|
{
|
|
class server;
|
|
class server_autotls;
|
|
}
|
|
|
|
#endif
|
|
|
|
class WSDoor
|
|
{
|
|
private:
|
|
websocketpp::server_autotls* mSEndpoint;
|
|
|
|
boost::thread* mThread;
|
|
bool mPublic;
|
|
std::string mIp;
|
|
int mPort;
|
|
|
|
void startListening();
|
|
|
|
public:
|
|
|
|
WSDoor(const std::string& strIp, int iPort, bool bPublic) : mSEndpoint(0), mThread(0), mPublic(bPublic), mIp(strIp), mPort(iPort) { ; }
|
|
|
|
void stop();
|
|
|
|
static WSDoor* createWSDoor(const std::string& strIp, const int iPort, bool bPublic);
|
|
};
|
|
|
|
#endif
|
|
|
|
// vim:ts=4
|