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
Consider the following piece of code.
import Server, { AuthenticateError } from 'aedes'; import * as net from 'net'; import { connect } from 'mqtt'; const mqttServer = new Server({ authenticate(_, __, password, callback) { if (password?.toString() !== 'MY GOOD SECURE PASSWORD') { const error: AuthenticateError = { ...new Error('Auth error'), returnCode: 4 }; callback(error, null); } else { callback(null, true); } } }); net .createServer(mqttServer.handle) .on('error', (err) => console.error(err)) .listen(1883, '192.168.0.21', () => { console.log(`Aedes server listening on 192.168.0.21:1883`); const mqttClient = connect('mqtt://192.168.0.21', { // username: 'does-not-matter', password: 'MY GOOD SECURE PASSWORD', reconnectPeriod: 2 * 1000 }) })
In this example, the client will never connect and you will never find out why until you comment the username back in.
The text was updated successfully, but these errors were encountered:
Would you like to submit a PR to fix this?
Sorry, something went wrong.
Add handling for password only connections (mqttjs#1685)
98d564d
No branches or pull requests
Consider the following piece of code.
In this example, the client will never connect and you will never find out why until you comment the username back in.
The text was updated successfully, but these errors were encountered: