Utilice 127.0.0.1 en lugar de localhost. Al apagar su interfaz wifi, el sistema operativo ya no puede resolver localhost.