moscajs / mosca

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

How can i use connect mqtt (port 1883) after enabling secure #645

Closed ghost closed 7 years ago

ghost commented 7 years ago

Dear authors

I am using Setting like this for Mosca. My target is that i want to enable Mosca to use MQTT and MQTT(SSL) at the same time. However, when i using the setting below, i cannot connect to Mosca with 1883, just only 8883 is fine. So is there anything wrong in my setting for my target ? Hope receiving your recommendation. Thanks

// - 1883 port for MQTT
// - 8883 port for MQTT(SSL)
// - 8083 for WebSocket/HTTP
// - 8084 for WSS/HTTPS
var settings = {
    port: 1883, // for MQTT
    backend: ascoltatore,
    secure : {
        port: 8883 , // for MQTT(SSL)
        keyPath: 'ssl-privkey-key.pem',
        certPath: 'ssl-fullchain-cert.pem',
    },
    https: { 
        port: 8084, // for WSS/HTTPS
        bundle: true,
        static: './'
    }
}
abrain commented 7 years ago

allowNonSecure, starts both the secure and the unsecure server.

see https://github.com/mcollina/mosca/wiki/Mosca-advanced-usage

ghost commented 7 years ago

Thank you, i fixed it

mcollina commented 7 years ago

Thank @abrain for helping out!