Created
November 8, 2010 15:40
-
-
Save kernow/667824 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var BOSH_SERVICE = 'https://jamie-template.local/http-bind/'; | |
var connection = null; | |
function rawInput(data) | |
{ | |
console.log('RECV: ' + data); | |
} | |
function rawOutput(data) | |
{ | |
console.log('SENT: ' + data); | |
} | |
function onConnect(status) | |
{ | |
if (status == Strophe.Status.CONNECTING) { | |
console.log('Strophe is connecting.'); | |
} else if (status == Strophe.Status.CONNFAIL) { | |
console.log('Strophe failed to connect.'); | |
} else if (status == Strophe.Status.DISCONNECTING) { | |
console.log('Strophe is disconnecting.'); | |
} else if (status == Strophe.Status.DISCONNECTED) { | |
console.log('Strophe is disconnected.'); | |
} else if (status == Strophe.Status.CONNECTED) { | |
console.log('Strophe is connected.'); | |
} | |
} | |
$(document).ready(function () { | |
connection = new Strophe.Connection(BOSH_SERVICE); | |
connection.rawInput = rawInput; | |
connection.rawOutput = rawOutput; | |
connection.connect('[email protected]', '69d394a7c03da1169ef3aab5efa661b4d590684d41794a5b56f560635f20dcc9', onConnect); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment