Which Protocol to use to control WiFi (esp 32) enabled Led Light
You can use your ESP as a server by the following code and then put your DigitalWrite(1, HIGH) line in the code like the following:
 String line = client.readStringUntil('\r');
 Serial.print(line);
if(line==&quot;ledon&quot;)
{
DigitalWrite(1, HIGH);
}

and at this point you just can call the following link to turn the led on
http://192.168.*.**/ledon

or whatever the starting of your ipv4 is.