fish-shell/fish-shell — pull request #1441 by amluto (2014-04-28 18:23:08+00:00)
Title: fish_config: Bind to localhost on an ephemeral port

Binding to all interfaces opens up an unnecessary attack surface and
alarms users of netstat -lt. The iterative binding hack is also ugly

Instead, just bind to (::1, 0) and read off the assigned ephemeral
port. Then aim the web browser at http://[::1]:PORT/.

This may cause issues on systems without working IPv6 loopback.
The current code was already broken on systems without IPv6,
so I don't expect this to be a problem in practice. If it ends
up being problematic, it wouldn't be too hard to fall back to
IPv4.