Add a new option to force 'localhost' as hostname instead of local ip

For configuration reasons, I cannot use the local ip "127.0.0.1" to execute my tests. So I added a new option to use "localhost" instead of "127.0.0.1" if any.