Nodemcu connection via wifi over distance Friend's Lamp

Hello Everybody!

I want to make 2 Friends Lamp with 2 Nodemcu. Ex: When I press a button from my nodemcu over distance (8 km) friend's nodemcu (both connected to internet) receives the signal and turn on a led ring and vice versa. How can I do that?

If the two nodemcu's are each connected to the Internet, why is it relavent that they are '8km' apart ?