# HG changeset patch # User Sonny Piers # Date 1326585719 -3600 # Node ID b7a582a2b32c20d93cde5d52609d0cc9bd483b83 # Parent 62c17284f3a15735316d6a3e081e59a1d08820be add the sub-protocol (xmpp) negociation diff --git a/lightstring.js b/lightstring.js --- a/lightstring.js +++ b/lightstring.js @@ -58,14 +58,16 @@ Lightstring.Connection = function (aServ //"Bug 695635 - tracking bug: unprefix WebSockets" https://bugzil.la/695635 try { - this.socket = new WebSocket(this.service); + this.socket = new WebSocket(this.service, 'xmpp'); } catch(error) { - this.socket = new MozWebSocket(this.service); + this.socket = new MozWebSocket(this.service, 'xmpp'); } var that = this; this.socket.addEventListener('open', function() { + if(this.protocol !== 'xmpp') + throw "Lightstring: The server located at "+that.service+" is not XMPP aware."; var stream = "