ESP8266 fail to connect MQTT broker
127.0.0.1 is not the address of your computer.  That is the address of the "loopback" interface - a virtual interface that allows a device to talk to itself.

That means that when you are using the MQTT server itself you can connect, because it's all the same computer.  However the ESP8266 is trying to connect to itself, not the MQTT server.

You need to replace 127.0.0.1 with the actual IP address of your MQTT server.

The simplest way of getting your computer's IP address is to open a terminal window and type:

hostname -I