thinking about it: anyone who's tech-savvy enough to want this should also be capable of writing "127.0.0.1" or "::1" in place of "localhost". so it's reasonable to eliminate the special treatment, and simplify the code