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

Не работает ChilliController.js. В чем проблема?

Я пытаюсь настроить ChilliController.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();


Вот сам запрос:
Request URL:
http://192.168.182.1:3990/json/status?callback=chilliJSON.reply&0.33341848012877806

Request Method:
GET
Status Code:
302 Moved Temporarily
Remote Address:
192.168.182.1:3990
Referrer Policy:
strict-origin-when-cross-origin

Выводится в alert: JSON request timed out (or reply is not valid)

Coova-chilli settings:
config chilli
    option tundev 'tun0'
    option network ''
    option ipup /etc/chilli/up.sh
    option ipdown /etc/chilli/down.sh

    # Radius parameters
    option radiusserver1 192.168.1.167
    option radiusserver2 192.168.1.167 
    option radiussecret testing123

    # DHCP Parameters
    option dhcpif br-lan
    option uamserver http://192.168.1.167/login.html
    #option uamsecret testing123
    #option uamdomain 192.168.1.167


Что я делаю не так? Я могу заверить вас, что имя пользователя и пароль верны.
  • Вопрос задан
  • 9 просмотров
Пригласить эксперта
Ваш ответ на вопрос

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

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