moscajs / mosca

MQTT broker as a module
mosca.io
3.2k stars 508 forks source link

Connecting to mosca via ws:// from another application #593

Closed diginfo closed 7 years ago

diginfo commented 7 years ago

Been trying to figure this out but I can't seem to !

How can I connect to mosca from another 3rd party websocket client which does not have access to and cannot install the mqtt.js libraries and may not be in javascript platform ??

diginfo commented 7 years ago

Ok, I figured this out, you need to enable the socket server:

var moscaSettings = {
  port: 1883,
  backend: ascoltatore,
  persistence: {
    factory: mosca.persistence.Redis
  },
  interfaces: [
    { type: "mqtt", port: 1883 },
    { type: "http", port: 3000, bundle: true, static: './' }
  ],
};