diff --git a/src/HttpClient.cpp b/src/HttpClient.cpp index 1c73464..d94e018 100644 --- a/src/HttpClient.cpp +++ b/src/HttpClient.cpp @@ -858,5 +858,18 @@ int HttpClient::readHeader() return c; } +int HttpClient::connect(IPAddress ip, uint16_t port) { + this->iServerName = NULL; + this->iServerAddress = ip; + this-> iServerPort = port; + return iClient->connect(ip, port); +}; +int HttpClient::connect(const char *host, uint16_t port) { + this->iServerName = host; + this->iServerAddress = IPAddress(); + this-> iServerPort = port; + return iClient->connect(host, port); +}; + diff --git a/src/HttpClient.h b/src/HttpClient.h index 6a7aa1d..a11e161 100644 --- a/src/HttpClient.h +++ b/src/HttpClient.h @@ -310,8 +310,8 @@ class HttpClient : public Client virtual void flush() { iClient->flush(); }; // Inherited from Client - virtual int connect(IPAddress ip, uint16_t port) { return iClient->connect(ip, port); }; - virtual int connect(const char *host, uint16_t port) { return iClient->connect(host, port); }; + virtual int connect(IPAddress ip, uint16_t port); + virtual int connect(const char *host, uint16_t port); virtual void stop(); virtual uint8_t connected() { return iClient->connected(); }; virtual operator bool() { return bool(iClient); };