I'm learning XMPP Based on Strophe.js and openfire server, because I need it in a future project.
I've configured my openfire admin account, mysql database, the Bosh Protocol and URL for http binding.
I created my first example, here's the html (I included all js files I need in the html header like strophe.js, flXHR.js and strophe.flXHR.js):
<ul>
<li>JID : <input type="text" name="jid" id="jid" /></li>
<li>PASS : <input type="password" name="password" id="password"/></li>
<li><input type="button" value="connect" id="connect" name="Connect" /></li>
</ul>
And this is the javascript code :
$(document).ready(function(){
connection=null;
$('#connect').click(function (ev) {
var jid=$('#jid').val();
var pass=$('#password').val();
var conn = new Strophe.Connection("http://127.0.0.1:2580/http-bind/");
conn.connect(jid, pass, function (status) {
console.log(status);
});
connection = conn;
});
});
When I test the code, I type my openfire server username and password (admin,123)... click "connect" and waiting.
The console.log shows the following status values:
1 (connecting)
3 (authenticating)
5 (connected)
To this point, everything is good... But when I type other values different than my admin username and pass, it gives me the same status results?
That means, the connection is established whatever is the input username and pass !!!
What's wrong?
anonymous=true
, I modified toanonymous=false
, but nothing changed, the same problem persists – SmootQ