We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If yes, please provide a sample myconfig_mqtts.js preferably with an AWS tls cert so we can subscribe to mqtts topics running on 8883
For example something like this
const fs = require('fs'); const mqtt = require('mqtt');
const options = { clientId: 'homer_client', key: fs.readFileSync('./certs/private.pem.key'), cert: fs.readFileSync('./certs/certificate.pem.crt'), ca: [ fs.readFileSync('./certs/root.ca') ] };
const client = mqtt.connect('mqtt://xxxxxx.iot.us-east-1.amazonaws.com:8883', options);
const topic = 'TOPIC';
client.on('connect', () => { console.log('connect'); client.subscribe(topic); });
client.on('message', (topic, message) => { const json = JSON.parse(message.toString()); console.log(json); });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
If yes, please provide a sample myconfig_mqtts.js preferably with an AWS tls cert so we can subscribe to mqtts topics running on 8883
For example something like this
const fs = require('fs');
const mqtt = require('mqtt');
const options = {
clientId: 'homer_client',
key: fs.readFileSync('./certs/private.pem.key'),
cert: fs.readFileSync('./certs/certificate.pem.crt'),
ca: [ fs.readFileSync('./certs/root.ca') ]
};
const client = mqtt.connect('mqtt://xxxxxx.iot.us-east-1.amazonaws.com:8883', options);
const topic = 'TOPIC';
client.on('connect', () => {
console.log('connect');
client.subscribe(topic);
});
client.on('message', (topic, message) => {
const json = JSON.parse(message.toString());
console.log(json);
});
The text was updated successfully, but these errors were encountered: