Although localhost is sometimes used as synonymous with package programs such as WAMP, XAMPP, or EasyPHP, this is also an incorrect definition. These programs broadcast using localhost as well as with other IP addresses defined on the computer.
The term Localhost refers to the computer on which a program is running. It is a loopback device that is assigned IP Address 127.0.0.1 in IPv4 (::1 for IPv6) and used to enable the computer to access it over TCP/IP.
Being able to communicate with the current machine as if it were communicating with a remote machine is useful for testing purposes, as well as for using features located on the current machine, but which are expected to be remote.
After briefly explaining what is localhost, what it means, I am going to provide detailed information and working logic that will clarify the definition.
Full Article Source: https://www.temok.com/blog/what-is-localhost/