Esp8266 is a chip that supports the tcp / ip protocol. With this chip for a few dollars you can log into the IOT world and create wonders. There are 2 ways to track or manipulate any data dynamically with the ESP8266. One is AJAX and the other is Websocket technology.
The following code is dynamically sending data with AJAX. ESP8266 is the server here. Once you have entered the IP address in the web browser, connect to the client when you are connected. In C ++, writing HTML as a string is really simple and very simple.
Long polling in communication with Ajax generates traffic for wifi. In this case it is not good for ESP8266. We will solve this problem with WebSocket technology. Websocker is a full duplex protocol and does not send data over long polls, such as ajax. Toggles connection data connection on / off. Thus traffic is reduced. The following code is an example written with WebSocket technology.