Created
January 11, 2017 22:22
-
-
Save damieng/08cbe33341e0cf4e505a0d6ecc684790 to your computer and use it in GitHub Desktop.
Get Proxy servers on Windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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