Step 1 : Fill in your own broker or use the one from the kind people at broker.mqttdashboard.com. (but be gentle...)
var client = new Messaging.Client('broker.mqttdashboard.com', 8000, 'myclientid1234');
Step 2 : Have the javascript client subscribe to a topic.
client.subscribe('testGaugeTopic/#', {qos: 2});
Step 3 : Start sending messages by copying this into your shell...
for i in {1..100} do mosquitto_pub -h broker.mqttdashboard.com -t testGaugeTopic/liveData --qos 2 -m "$(((RANDOM%6500)+1))|$(((RANDOM%120)+1))|40.69847032728747|-73.9514422416687"; done
Or download this shell script for some dummy data