Safari can't connect to localhost
I'm trying to use Focus, an app that redirects blocked websites through localhost. However, while this works properly with Chrome and Firefox, Safari gives me an error message as in the attached image.
If in the web address I replace localhost with 127.0.0.1 everything works fine. How can I fix this?
The content of my /private/etc/hosts file is the default one, i.e.
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
MacBook Pro 15", macOS 10.14