Earlier quoted context omitted.
No, if your application is distributed, you won't be referring to localhost.
And why not? If we are running distributed services, we know the machine that the code is run on is running. We can even reference this by many languages version of "this" keyword. localhost is only "this" for IP4/6
Let 'localhost' be localhost
111–117 of 117 posts
Re: Let 'localhost' be localhost
#112Is there an actual case to be made for pointing localhost to anything other than the loopback device?
Chrome on Android lets you bind your phone/tablet's localhost to your computer's localhost. This enables you to test during development, even if your corporate IT people disallow connections between devices on the same WiFi network (or partition personal devices onto a different network than corporate hardware).
I think it also follows the spirit of the idea since the change is local to the machine you're using.
[1] https://developers.google.com/web/tools/chrome-devtools/debu...
Re: Let 'localhost' be localhost
#113So ".localhost." means "every domain within the 'localhost' tld", not "every domain that contains the string 'localhost'".
Re: Let 'localhost' be localhost
#114Earlier quoted context omitted.
Thankfully IPv6 defined a single "localhost" or loopback IP: ::1/128 There is none of this 127/8 mess.
that "mess" is great for testing though, you can spin up numerous instances each on their own loopback address.
Re: Let 'localhost' be localhost
#115Re: Let 'localhost' be localhost
#116Earlier quoted context omitted.
that "mess" is great for testing though, you can spin up numerous instances each on their own loopback address.
You can use a link local address of your public interface in IPv6.
Re: Let 'localhost' be localhost
#117I have had a number of customers who have broken our applications, which have daemons listening on localhost, by editing their /etc/hosts files and removing the localhost entry. I guess various people edit /etc/hosts to prevent applications from talking to licensing servers, and in the process happen to accidentally blow away the localhost entry (since these customers don't know what they're doing). We had this happe…
While some people might edit their host for nefarious purposes, I think it's wrong to attribute all of it to malice. Personally, I set the host file to use https://github.com/StevenBlack/hosts in order to block ads on every computers I touch. I also often use software that manage the host file and ignore the default physical file.