Hi, Mosquitto itself doesn't talk websockets, so you need something inbetween to work as a proxy. You could do this with e.g. lighttpd and mod_websockets.
Cheers, Roger On Tue, Jun 25, 2013 at 5:50 AM, 458389897 <[email protected]> wrote: > Hello, > > I'm using mosquitto(1.1.3) on ubuntu os. I use the Paho library(MQTT > JavaScript Client,mqttws31.js) to connect to the server,but always get error > messages.On the server side error message is "Socket read error on client > (null), disconnecting".On the client side error message is "AMQJS0008I > Socket closed". > > Code: > > var client; > function onConnect() { > // Once a connection has been made, make a subscription and send a > message. > console.log("onConnect"); > client.subscribe("#"); > }; > function onFail(s) { > alert("errorMessage" + s.errorMessage); > }; > function onConnectionLost(responseObject) { > if (responseObject.errorCode !== 0) > console.log("onConnectionLost:"+responseObject.errorMessage); > }; > function onMessageArrived(message) { > console.log("onMessageArrived:"+message.payloadString); > alert("onMessageArrived:"+message.payloadString); > //client.disconnect(); > }; > > window.onload=function(){ > > client = new Messaging.Client("218.195.250.236", Number(1883), > "umk_js_client"); > client.onConnectionLost = onConnectionLost; > client.onMessageArrived = onMessageArrived; > client.connect({onSuccess:onConnect,onFailure:onFail}); > }; > > Hoping to get help, thank you. > > > > -- > Mailing list: https://launchpad.net/~mosquitto-devel > Post to : [email protected] > Unsubscribe : https://launchpad.net/~mosquitto-devel > More help : https://help.launchpad.net/ListHelp > -- Mailing list: https://launchpad.net/~mosquitto-devel Post to : [email protected] Unsubscribe : https://launchpad.net/~mosquitto-devel More help : https://help.launchpad.net/ListHelp

