登录匿名openfire

时间:2013-03-18 20:27:40

标签: openfire strophe

我跟着这个:

Anonymous Login in Openfire with Strophe

我把域名作为用户名和密码null。 openfire属性xmpp.auth.anonymous = true

我尝试了很多配置e没什么用。我错过了什么?

我使用骨干和下划线。这是我的代码

   _.extend(Chat.prototype, Backbone.Events, {
    connect : function() {
        var self = this;    
        this.connection = new Strophe.Connection(BOSH_SERVICE);
        this.connection.connect('brent029', null, function(status) {
            self.onConnect(status);   
        });
    },

    onConnect : function(status) {
        switch(status) {
            case Strophe.Status.CONNECTED:
                this.sendPresConference();
                break;
            default:
                break;
       }
    },


    sendPresConference : function(){
        this.connection.send(
            $pres({
                to : 'room@conference_service/nick'
            })
            .c('x',{ 
                xmlns : Strophe.NS.MUC 
            }).tree()
        );
    },             

1 个答案:

答案 0 :(得分:0)

我解决了。

openfire有一个属性sasl.mechs

这个属性的值是“PLAIN”。

我将值更改为“ANONYMOUS,PLAIN”。

然后,我重启了openfire,现在工作正常。

相关问题