我尝试使用的strophe注册-插件(注册一个XMPP账户https://github.com/metajack/strophejs-plugins/tree/master/register )。 它工作正常,从例如“连接管理器http://bosh.metajack.im:5280/xmpp-httpbind ”,但使用的Openfire连接管理器,我不能注册帐号。 (正常登录可工作在连接管理器...)
连接状态更改为1 - > 10,多数民众赞成它。 1分表示“连接”,但我不知道是什么10种手段...
var connection = new Strophe.Connection(
// "http://bosh.metajack.im:5280/xmpp-httpbind");
"http://localhost/http-bind");
var callback = function (status) {alert(status);
if (status === Strophe.Status.REGISTER) {
connection.register.fields.username = "fghdfhg";
connection.register.fields.name = "dfgfdgfdg";
connection.register.fields.password = "dfddfgfdg";
connection.register.submit();
} else if (status === Strophe.Status.REGISTERED) {
console.log("registered!");
connection.authenticate();
} else if (status === Strophe.Status.CONNECTED) {
$(document).trigger('connected');
} else if (status === Strophe.Status.DISCONNECTED) {
console.log("Disconnected from XMPP-Server");
}
};
// connection.connect(data.jid, data.password, callback);
connection.register.connect("xyz.com", callback, 60, 1);