Skip to content

Instantly share code, notes, and snippets.

@damieng
Created January 11, 2017 22:22
Show Gist options
  • Select an option

  • Save damieng/08cbe33341e0cf4e505a0d6ecc684790 to your computer and use it in GitHub Desktop.

Select an option

Save damieng/08cbe33341e0cf4e505a0d6ecc684790 to your computer and use it in GitHub Desktop.
Get Proxy servers on Windows
exports.getProxyServers = (callback) => {
try {
new Registry('\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings')
.get('ProxySever', (err, val) => {
callback(err, err ? undefined || Object.assign({}, ...val.split(';').map(v => v.split('=')).map(v => ({[v[0]]: v[1]}))))
})
} catch (err) {
callback(err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment