kreta99 / QS-Custom-Forms

GNU General Public License v3.0
9 stars 3 forks source link

Might not work in multinode environments, obsolete buffer #6

Open analienx opened 5 years ago

analienx commented 5 years ago

In some environments it takes the same proxy only everytime regardless of from which proxy it is actually installed. Applying loop works in some cases, it seems hardcoding of id of the proxy can be used in emeregencies. Also buffer seems to be obsolete...

//set new base64 encoded forms in Proxy properties structure
    body.settings.formAuthenticationPageTemplate = Buffer.from(login_form).toString('base64');
    body.settings.loggedOutPageTemplate = Buffer.from(logout_form).toString('base64');
    body.settings.errorPageTemplate = Buffer.from(error_form).toString('base64');

Processing multiple proxies

    for (pid in body){
        var proxyid = body[pid].id; 

        options.uri = 'https://' + hostname + ':4242/qrs/ProxyService/' + proxyid + '?xrfkey=1234567891234567';

        request(options, function (error, response, body) {
            if(error){
                console.log("Error: " + error);
            }
            else{

                setCustomForms(body);
                //console.log("Set for proxy:"+proxyid);
            }
        });
    }

Hardcoded id for emergency cases when nothing else works

function getProxyProp(body) {
            var proxyid = "27402a61-2364-4edc-a0b3-07477169d119";//proxy id for emergencies when nothing else works body[0].id;