зарегистрироваться через strophe.register.js не работает

я получаю

TypeError: that._buildBody не является ошибкой функции.

Я использую https://github.com/strophe/strophejs-plugins/tree/master/register

<script type="text/javascript" src="/Static/js/strophe.min.js"></script>
<script type="text/javascript" src="/Static/js/strophe.register.js"></script>
<script type="text/javascript">
$(document).ready(function () {
    connection = new Strophe.Connection("ws://127.0.0.1:5280/websocket");
    var callback = function (status) {
        if (status === Strophe.Status.REGISTER) {
            // fill out the fields
            connection.register.fields.username = "abcd";
            connection.register.fields.password = "abcd";
            // calling submit will continue the registration process
            connection.register.submit();
        } else if (status === Strophe.Status.REGISTERED) {
            console.log("registered!");
            // calling login will authenticate the registered JID.
            connection.authenticate();
        } else if (status === Strophe.Status.CONFLICT) {
            console.log("Contact already existed!");
        } else if (status === Strophe.Status.NOTACCEPTABLE) {
            console.log("Registration form not properly filled out.")
        } else if (status === Strophe.Status.REGIFAIL) {
            console.log("The Server does not support In-Band Registration")
        } else if (status === Strophe.Status.CONNECTED) {
            // do something after successful authentication
        } else {
            // Do other stuff
        }
    };
    connection.register.connect("Vostro-3558-PC", callback, 60, 1);
});
</script>

person abhijit    schedule 05.02.2016    source источник
comment
я использую вышеуказанный strope.register.js для регистрации   -  person abhijit    schedule 05.02.2016
comment
Проверьте мой ответ здесь: -плагин/   -  person beaver    schedule 07.02.2016
comment
Пожалуйста, проголосуйте за мой ответ там, если он полезен для вас :)   -  person beaver    schedule 08.02.2016


Ответы (1)


Я только что сам столкнулся с этим. Мне кажется, что strophe.register.js не работает с веб-сокетами - функция _buildBody специфична для протокола BOSH.

person ABundy    schedule 29.04.2016