0

クライアントチャットを作成しようとしています。Punjab サーバーのログを送信 - 受信として見ることができました。しかし、Strophes Connectedとして表示されることはありません 次のセットアップを行いました

1) Xmpp サーバーのセットアップ

wget -O openfire.deb http://www.igniterealtime.org/downloadServlet?filename=openfire/openfire_3.9.3_all.deb https://www.digitalocean.com/community/tutorials/how で説明されているようにセットアップを完了しました -to-install-openfire-xmpp-server-on-a-debian-or-ubuntu-vps これで、*****xmppserver.com で openfire にアクセスできます

2) 同じサーバーに Punjab Bosh Server をセットアップする github からダウンロードして

https://github.com/twonds/punjab/blob/master/INSTALL.txt

twistd -ny punjab.tac で実行を開始しました

としてetc/hosts追加されました

127.0.0.1 *****xmppserver.com

3) 最後に最新の strophes.js をダウンロードし、basic.js を編集します

var BOSH_SERVICE = 'http://*****xmppserver.com:5280/http-bind';

出力が接続中として表示され、接続済みになることはありません!!

function onConnect(status) {
        console.log(status);
        if (status == Strophe.Status.CONNECTING) {
            log('Strophe is connecting.');
        } else if (status == Strophe.Status.CONNFAIL) {
            log('Strophe failed to connect.');
            $('#connect').get(0).value = 'connect';
        } else if (status == Strophe.Status.DISCONNECTING) {
            log('Strophe is disconnecting.');
        } else if (status == Strophe.Status.DISCONNECTED) {
            log('Strophe is disconnected.');
            $('#connect').get(0).value = 'connect';
        } else if (status == Strophe.Status.CONNECTED) {
            log('Strophe is connected.');
            log('Send a message to ' + connection.jid +
            ' to talk to me.');

            connection.addHandler(onMessage, null, 'message', null, null,  null);
            connection.send($pres().tree());
        }
    }

ここに画像の説明を入力

4

1 に答える 1