Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] Errors using Paho to connect to

And I think I've answered my own question. When I retained "client" in a variable outside of this function, things are starting to move along. 


On Fri, Dec 13, 2013 at 3:33 PM, David Janes <davidjanes@xxxxxxxxxxxxxx> wrote:
This is my first attempt at using Paho in the browser and I'm trying to duplicate what ( does. Unfortunately, all I get is 

onConnectionLost:AMQJS0005E Internal error. 

I've been successful at connecting to the broker from the command line using Mosquitto.

Now I realize that the Internal error is happening in "" but since it works on their website, it must be the way I'm calling it. So the question is : am I doing something obviously wrong in the following code:

var location = { 
    hostname: "",
    port: 8000,
    clientid: "iot-" + ("" + Math.random()).substring(2)
var client = new Messaging.Client(

client._onConnectionLost_ = js.mqtt.onConnectionLost;
client._onMessageArrived_ = js.mqtt.onMessageArrived;

var connectd = {
    timeout: 3,
    keepAliveInterval: 60,
    cleanSession: true,
    useSSL: false,


Back to the top