Use esp32_firewall_api as package

This commit is contained in:
Florian Hoss 2022-07-26 12:49:46 +02:00
parent 28a0753d3a
commit 929aaf39a3
7 changed files with 28 additions and 22 deletions

View file

@ -2,10 +2,10 @@
namespace fw
{
API::API(fw::Firewall *firewall, const char *cert, const char *key, const char *username, const char *password, const uint16_t port)
API::API(fw::Firewall *firewall, const char *cert, const char *key, const char *username, const char *password, const String ip, const uint16_t port)
{
this->firewall = firewall;
this->api_ip = WiFi.localIP().toString();
this->api_ip = ip;
this->api_port = port;
if (this->setup_auth(username, password) == ERROR)
endless_loop();

View file

@ -16,7 +16,7 @@ namespace fw
class API
{
public:
API(Firewall *, const char *cert, const char *key, const char *username, const char *password, const uint16_t port = 8080);
API(Firewall *, const char *cert, const char *key, const char *username, const char *password, const String ip, const uint16_t port = 8080);
~API();
void handle_client();

View file

@ -47,7 +47,7 @@ void setup()
Serial.print("[WiFi] IP: ");
Serial.println(WiFi.localIP());
firewall = new fw::Firewall();
firewallApi = new fw::API(firewall, cert, key, username, password);
firewallApi = new fw::API(firewall, cert, key, username, password, WiFi.localIP().toString());
wifiServer.begin();
}