You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
what i want to do is using mosecurity for rule check, and i don't want to use nginx-modsecurity-connector or apache, so i want to make a http server this use modsecruity direct, for example, we can use httplib_cpp + modsecurity make a pure server , how can i do it.
#defineCPPHTTPLIB_OPENSSL_SUPPORT
#include"path/to/httplib.h"
#include"path/to/modsecurity.h"using ModSecurity::ModSecurity;
using ModSecurity::Rules;
using ModSecurity::Transaction;
booldo_modsecurity_parse_and_inject( ... ){
ModSecurity *modsec;
ModSecurity::Rules *rules;
modsec = newModSecurity();
rules = newRules();
rules->loadFromUri(rules_file);
Transaction *modsecTransaction = newTransaction(modsec, rules);
// modsecTransaction->processConnection("127.0.0.1");
}
if (modsecTransaction->intervention()) {
std::cout << "There is an intervention" << std::endl;
}
// HTTP
httplib::Server svr;
// HTTPS
httplib::SSLServer svr;
svr.Get("/hi", [](const httplib::Request &, httplib::Response &res) {
res.set_content("Hello World!", "text/plain");
// what i want to get the using way. auto is_inject = do_modsecurity_parse_and_inject( ... );
});
svr.listen("0.0.0.0", 8080);
The text was updated successfully, but these errors were encountered:
what i want to do is using mosecurity for rule check, and i don't want to use nginx-modsecurity-connector or apache, so i want to make a http server this use modsecruity direct, for example, we can use httplib_cpp + modsecurity make a pure server , how can i do it.
The text was updated successfully, but these errors were encountered: