3.0.1 • Published 8 months ago
winproxy v3.0.1
Read proxy settings for windows.
Installation via
$ npm install -s winproxy
WinProxy.loadAsync().then(function() {
WinProxy.getAsync('https://comlog.org')
.then(function(proxy) {
console.info(proxy);
})
.catch(function(err) {
console.error(err);
});
});
// OR get Proxy URL for a URL
WinProxy.loadAsync()
.then(function() {
WinProxy.getURL('https://comlog.org')
.then(function(proxy) {
console.info(proxy);
})
.catch(function(err) {
console.error(err);
});
})
.catch(function(err) {
console.error(err);
});
// Inside async Function
async function test() {
await WinProxy.loadAsync();
let proxy = await WinProxy.getAsync('https://comlog.org');
let proxyUrl = await WinProxy.getURL('https://comlog.org');
console.info(proxy, proxyUrl);
}
WinProxy.load(function(err) {
if (err) console.error(err);
console.info(WinProxy.HTTPServer);
console.info(WinProxy.HTTPPort);
});
// OR get Proxy for a URL
WinProxy.load(function(err) {
if (err) console.error(err);
WinProxy.get('http://comlog.org', function(err, proxy) {
console.info(proxy);
});
});
// OR get Proxy URL for a URL
WinProxy.load(function(err) {
if (err) console.error(err);
WinProxy.getURL('http://comlog.org', function(err, proxy) {
console.info(proxy);
});
});