You cannot just remove stuff from weewx.conf or make random configurations up out of thin air and expect things to work...
You have to specify the hostname or ip address of your MQTT broker computer. Do not use localhost or 127.0.0.1, as the connection will be from your 'browser' computer to the MQTT broker computer.
Here is my example configuration for weewx using a MQTT host that has address 192.168.1.177 on my LAN.
# this publishes weewx data to the MQTT broker
[[MQTT]]
topic = weather
binding = archive, loop
log_success = False
# this configures Belchertown to request MQTT data using websockets
[[Belchertown]]
[[[Extras]]]
mqtt_websockets_enabled = 1
mqtt_websockets_host = 192.168.1.177
mqtt_websockets_port = 9001
You also need your MQTT broker configured to listen on the two ports.
I do it by putting two files in /etc/mosquitto/conf.d on the MQTT broker host.
# this is /etc/mosquitto/conf.d/1883.conf
allow_anonymous true
listener 1883
protocol mqtt
# this is /etc/mosquitto/conf.d/9001.conf
allow_anonymous true
listener 9001
protocol websockets