network – Safari can not connect to localhost

I'm trying to use Focus, an application that redirects blocked websites through localhost. However, while this works properly with Chrome and Firefox, Safari gives me an error message like in the attached image.

If in the web address I substitute localhost with 127.0.0.1 everything works fine How can I fix this?

The content of my / private / etc / hosts The file is the default, that is,

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is starting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcastthost
:: 1 localhost
fe80 :: 1% lo0 localhost

enter the description of the image here