- Notifications
You must be signed in to change notification settings - Fork3
This project wraps mqtt.js to run a bundled (browserify) version for the browser within a Web-Worker
License
mqttjs/mqtt-worker
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This project wraps mqtt.js to run a bundled (browserify) version for the browser within aWeb Worker. Currentlythis project is still prototypical and needs some work, feel free to help.
bower install --save mqttjs/mqtt-worker<scriptsrc="bower_components/mqtt-wrapper/dist/MqttWorker.js"></script><script>varMqttWorker=require('MqttWorker');varmqtt=newMqttWorker("../mqttWorker.js",document.URL,true);// use the same API on mqtt available from https://github.com/mqttjs/MQTT.jsvarclient=mqtt.connect("ws://localhost:3005");client.setMaxListeners(11);client.on('connect',function(packet){console.log('MQTT.js is connected',packet);});client.subscribe('presence');client.publish('presence','Hello mqtt!');client.on('message',function(topic,message,packet){// message is Buffer casting to Stringconsole.log(String.fromCharCode.apply(null,message),packet);client.end();});client.on('close',function(){console.log('close');});</script>
In Chrome Web Workers can be debuged at chrome://inspect/#workers.
npm installgruntor
browserify -r ./lib/client.js:MqttWorker > dist/MqttWorker.jsbrowserify -r mqtt > dist/MqttBundle.jsmqtt-worker is anOPEN Open Source Project. This means that:
Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project.
See theCONTRIBUTING.md file for more details.
mqtt-worker is only possible due to the excellent work of the following contributors:
| Sandro Kock | GitHub/sandro-k | Twitter/@_syn_k |
|---|
About
This project wraps mqtt.js to run a bundled (browserify) version for the browser within a Web-Worker
Resources
License
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.