What happens when we move to https protocol ?
I suspect that use a relative protocol with //localhost can be a better choice.