moscajs / mosca

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

reconnects when using credentials #681

Closed tery1125 closed 6 years ago

tery1125 commented 6 years ago

I am learning about mqtt and for the first step, I tried connection between two files. Then I tried them with credential options, but one file keeps on reconnecting. It successfully denies access when the password is wrong, but there is no difference between two file's connecting code. const client = mqtt.connect('mqtt://127.0.0.1:1883',{username:'controller',password: 'pass'}); const client = mqtt.connect('mqtt://127.0.0.1:1883', {username:'garage1',password: 'pass'});

and the credential file has these informations on it.

One with the username controller works fine, but the other one keeps on reconnecting.