feat: add full HTTP/HTTPs support
This commit is contained in:
@@ -2,6 +2,11 @@
|
||||
|
||||
#include <thread>
|
||||
#include <atomic>
|
||||
#include <string>
|
||||
#include <openssl/ssl.h>
|
||||
#include <openssl/err.h>
|
||||
#include "cert_manager.h"
|
||||
#include <nerutils/callback.h>
|
||||
|
||||
#define PROXY_PORT 1337
|
||||
|
||||
@@ -15,11 +20,20 @@ public:
|
||||
bool Init();
|
||||
void Shutdown();
|
||||
|
||||
CallbackEvent<const std::string&, std::string&> OnClientRequest;
|
||||
CallbackEvent<const std::string&, std::string&> OnServerResponse;
|
||||
|
||||
private:
|
||||
void loop();
|
||||
void handleClient(SOCKET clientSocket);
|
||||
|
||||
bool initSSL();
|
||||
void cleanupSSL();
|
||||
|
||||
SOCKET _listenSocket = 0;
|
||||
std::thread _workerThread;
|
||||
std::atomic<bool> _running;
|
||||
|
||||
CertManager _certManager;
|
||||
SSL_CTX* _clientCtx = nullptr;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user