我想添加一個用戶在ejabberd服務器上使用strophe與輸出ejabberdctl註冊uname servename passwd在命令提示符下。是否有可能實現?是否有任何 XMPP協議存在註冊用戶?strophe註冊用戶上ejabberdctl
感謝 Sathi
我想添加一個用戶在ejabberd服務器上使用strophe與輸出ejabberdctl註冊uname servename passwd在命令提示符下。是否有可能實現?是否有任何 XMPP協議存在註冊用戶?strophe註冊用戶上ejabberdctl
感謝 Sathi
是的,它是可能的...你需要允許在服務器上註冊的內聯。完成之後,您可以從任何客戶端或客戶端庫中執行此操作,其中包括strophe.js。
使用mod_admin_extra和mod_rest,您將獲得對jabberctl +的一些額外命令的完全restfull訪問。搜索模塊文檔以獲取更多關於如何設置的信息。
我使用strophe.register.js
$("#register").click(function() {
var connect = new Strophe.Connection('http://yourserver.com/http-bind');
var callback = function (status) {
if (status === Strophe.Status.REGISTERING) {
console.log('REGISTERING')
}
else if (status === Strophe.Status.REGIFAIL) {
console.log('REGIFAIL')
}
else if (status === Strophe.Status.REGISTER) {
console.log('REGISTER')
connect.register.fields.username = "joe"
connect.register.fields.password = "doe"
connect.register.submit();
}
else if (status === Strophe.Status.SUBMITTING) {
console.log('SUBMITTING')
}
else if (status === Strophe.Status.SBMTFAIL) {
console.log('SBMTFAIL')
console.log('Something went wrong...');
}
else if (status === Strophe.Status.REGISTERED) {
console.log('REGISTERED')
console.log('Your account has been created successfully and is ready to use!');
}
}
connect.register.connect("yourserver.com", callback);
});