Tuesday, 14 March 2017

how can I get system proxy setting in node js

I'm writing a desktop application on windows with electron. Now I need to use the System global proxy setting as my own proxy while using request to get some data like this

    request({
        url: "http://ahdas.drnh.gov.tw/index.php",
        method: "POST",
        proxy: this.proxyRequestUrl,
        headers: {
            "User-Agent": this.mainWindow.webContents.session.getUserAgent(),
            "Accept": "application/json, text/javascript, */*; q=0.01",
            "Accept-Encoding": "gzip, deflate",
            "Cookie": cookies
        },
        form: {'act': 'Display/built/' + bookKey + "/" + postPageKey}
    }, (err, response, body) => {

    });

So, how can I get the System global proxy settings and assign that to this.proxyRequestUrl?



via zzm

No comments:

Post a Comment