Is it possible to be connected to TTN with mqttws31.js


Is it possible to be connected to TTN with MQTT WebSockets (mqttws31.js)
Actually, I’ve got this error message in my browser console:

Firefox can not establish connection with the server ws://
mqttws31.js Connection Message Error AMQJSC0001E Connect timed out

I though I should to put my authentication as "“userid” and “password”, in my code, but I don’t know how to.


Thanks Arjan,

At least, it clear.

I read all examples on ttn npm page. I didn’t find how to put the hostname of the server like “” I put in mine python scripts.

Do you have some documentation or example about ?

See A Python program to listen to your devices with MQTT.

Hi ArjanVanb,

Sorry I didn’t answered well.
My python script is working well. I meant how to pus the the authentication and host is the nodejs script using ttn and packages.