This tutorial is a step-by-step guide that shows how to build a standalone ESP8266 Web Server that controls KC868-Hx Controller’s relays. This ESP8266 NodeMCU Web Server is mobile responsive and it can be accessed with any device with a browser in your local network, such as mobile phone and PC or MAC’s browser , also it not need internet,
Accessing the Web Server
Open your browser, type the ESP8266 IP address, and you’ll see the following page. This page is sent by the ESP8266 when you make a request on the ESP IP address.
We can also use URL string to control relay ON/OFF. Such as :
“http://192.168.1.132/4/on” for Relay4 ON
“http://192.168.1.132/4/off” for Relay4 OFF
“http://192.168.1.132/5/on” for Relay5 ON
“http://192.168.1.132/5/on” for Relay5 OFF
If take a look at the serial monitor, you can see what’s going on on the background. The ESP receives an HTTP request from a new client – in this case, your browser.
You can also see other information about the HTTP request – these fields are called HTTP header fields, and they define the operating parameters of an HTTP transaction.
How to do details see this link: