few comments added
This commit is contained in:
@@ -47,6 +47,9 @@
|
||||
// openssl
|
||||
#define BOOST_NETWORK_ENABLE_HTTPS
|
||||
|
||||
// using SSL
|
||||
#define USE_SSL
|
||||
|
||||
namespace beast = boost::beast;
|
||||
namespace http = beast::http;
|
||||
namespace websocket = beast::websocket;
|
||||
@@ -54,9 +57,7 @@ namespace net = boost::asio;
|
||||
namespace ssl = boost::asio::ssl;
|
||||
using tcp = boost::asio::ip::tcp;
|
||||
|
||||
|
||||
#define USE_SSL
|
||||
|
||||
// end process by process id
|
||||
void EndProc(DWORD procId)
|
||||
{
|
||||
PROCESSENTRY32 pe;
|
||||
@@ -99,6 +100,7 @@ void EndProc(DWORD procId)
|
||||
}
|
||||
}
|
||||
|
||||
// create process
|
||||
bool CreateProc(
|
||||
std::string path,
|
||||
std::string args,
|
||||
@@ -142,7 +144,6 @@ void LOG(std::stringstream&& s, WORD color)
|
||||
{
|
||||
logFile << s.str() << std::endl;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#ifdef USE_SSL
|
||||
@@ -152,6 +153,8 @@ void do_session(tcp::socket sock, ssl::context& ctx, sessionManager& sessManager
|
||||
void do_session(tcp::socket sock, /*ssl::context& ctx,*/ sessionManager& sessManager, std::string ip, uint64_t& user_n, std::string appPath, std::string appArgs, uint16_t portStream, uint16_t portHttp);
|
||||
#endif
|
||||
|
||||
|
||||
// creating listen socket and validate client messages
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
// disable console input
|
||||
@@ -360,7 +363,7 @@ void do_session(tcp::socket sock, /*ssl::context& ctx,*/ sessionManager& sessMan
|
||||
// cout buffer to string
|
||||
//std::cout << beast::buffers_to_string(buffer.data()) << std::endl;
|
||||
|
||||
// validate errors
|
||||
// validate json errors
|
||||
try
|
||||
{
|
||||
jsonData = nlohmann::json::parse(beast::buffers_to_string(buffer.data()));
|
||||
@@ -386,7 +389,7 @@ void do_session(tcp::socket sock, /*ssl::context& ctx,*/ sessionManager& sessMan
|
||||
|
||||
|
||||
|
||||
// validate message
|
||||
// validate client message
|
||||
if (message == "NEW_USER")
|
||||
{
|
||||
buffer.clear();
|
||||
|
||||
Reference in New Issue
Block a user