@pahandro
Студент, программист на C, JS

Птыаюсь подключить ChilliLibrary.js в nodejs. Почему не работает?

Всем привет! Пытаюсь настроить авторизацию в captive portal при помощи coova-chilli и ChilliLibrary.js. Вот мой код для авторизации

document.getElementById("loginForm").addEventListener("submit", async (event) => {
    event.preventDefault();
    const urlParams = new URLSearchParams(window.location.search);

    const username = document.getElementById("username").value;
    const password = document.getElementById("password").value;
    chilliController.host = urlParams.get('uamip');
    chilliController.port = urlParams.get('uamport');
    chilliController.interval = 60;
    chilliController.challenge = urlParams.get('challenge');
    chilliController.session = urlParams.get('sessionid');
    chilliController.redir = urlParams.get('userurl');

    chilliController.onError = handleErrors;
    chilliController.onUpdate = updateUI;

    setTimeout(() => {
        chilliController.logon(username, password);
    }, 1000);
});

function updateUI(cmd) {
    alert('You called the method' + cmd + '\n Your current state is =' + chilliController.clientState);
}

function handleErrors(code) {
    alert('The last contact with the Controller failed. Error code =' + code);
}

chilliController.refresh();


Я могу заверить что все данные правильны и нет ошибок с чтением.
Получаю ошибку:
The last contact with the Controller failed. Error code =JSON request timed out (or reply is not valid).

Перевести могу, но понять что нет так - не могу.
В запросе вот такое:
http://192.168.182.1:3990/json/status?callback=chilliJSON.reply&0.14191210940886223

В url страницы вот такое
http://localhost:63342/captive_portal/html/login.html?res=notyet&uamip=192.168.182.1&uamport=3990&challenge=3879e2ff9fcf03fbdf8e77c1bccf6523&called=48-22-54-1A-DF-E2&mac=38-87-D5-6B-AA-94&ip=192.168.182.6&nasid=nas01&sessionid=171516653200000001&userurl=http%3a%2f%2f192.168.1.1%2fcgi-bin%2fluci%2fadmin%2fnetwork%2ffirewall%2fzones&md=99D686754C554FA33CF4E8FBE7128739
  • Вопрос задан
  • 35 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы