thinking about how to compare firewall rules
This commit is contained in:
parent
3e1ec7ebb0
commit
50ebe9a5a4
2 changed files with 24 additions and 0 deletions
|
@ -11,6 +11,7 @@
|
|||
|
||||
fw::Firewall *firewall;
|
||||
String ip = "0.0.0.0";
|
||||
WiFiServer wifiServer(80);
|
||||
|
||||
void setup_wifi()
|
||||
{
|
||||
|
@ -27,6 +28,7 @@ void setup_wifi()
|
|||
Serial.print("IP Address: ");
|
||||
ip = WiFi.localIP().toString();
|
||||
Serial.println(ip);
|
||||
wifiServer.begin();
|
||||
}
|
||||
|
||||
void setup()
|
||||
|
@ -37,5 +39,19 @@ void setup()
|
|||
|
||||
void loop()
|
||||
{
|
||||
WiFiClient client = wifiServer.available();
|
||||
if (client)
|
||||
{
|
||||
Serial.print("Client connected with IP:");
|
||||
Serial.println(client.remoteIP());
|
||||
|
||||
if (firewall->check_client(client))
|
||||
Serial.println("good client");
|
||||
else
|
||||
Serial.println("bad client");
|
||||
|
||||
client.stop();
|
||||
Serial.println("Client disconnected");
|
||||
}
|
||||
firewall->handle_api_client();
|
||||
}
|
Reference in a new issue