I use TOR as a proxy. TOR actually refuses to establish connection to localhost, so I set NO_PROXY
NO_PROXY=localhost,127.0.0.1,::1
It enables connections to http://localhost and http://127.0.0.1 and does not work for http://[::1] at all.
Apparently the problem is caused by an assumption that a hostname cannot contain a colon.