Quantcast
Channel: Ignite Realtime : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 10742

Anyone Got Strophe.js to Work with WebSocket Plugin?

$
0
0

Hi:

 

I wonder if anyone ever got Strophe.js to work with the WebSocket plugin on OpenFire? I tried to connect to my OpenFire server using Strophe.js with below code. I am using the last version of Strophe.js (version 1.1.3), and latest version of the plugin (version 0.0.0.6). I tried to debug Strophe. When it opens, it sent a message "<stream:stream to='chat-uat.seyzme.net' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>" to Openfire. However, on the Openfire side, it is complaining "org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 125; XML document structures must start and end within the same entity.".

 

function connectHandler(cond) {

  if(cond == Strophe.Status.CONNECTED) {

    alert("connected");

  } else {

    alert("status: " + cond);

  }

}

 

 

var username = "****";

var password = "****";

var url = "ws://foo:7070/ws/server?username=" + username + "&password=" + password + "&resource=xmpp";

var connection = new Strophe.Connection(url);

connection.connect(username, password, connectHandler);

 

The above code was run from http://foo:7070/ws/peek/test/, so cross domain is not an issue.


Viewing all articles
Browse latest Browse all 10742

Trending Articles