1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-25 20:53:15 +00:00

Added support for fetching system proxy settings from gnome

This commit is contained in:
Bryan Roe
2019-08-12 11:27:15 -07:00
parent 7fa076a0cb
commit bc2ef6a3f4
3 changed files with 27 additions and 7 deletions

View File

@@ -444,6 +444,16 @@ int MeshAgent_GetSystemProxy(MeshAgentHostContainer *agent, char *buffer, size_t
child.ret = child.stdout.str.trim().split('\\n')[0].split('//')[1];\
if(child.ret != '') { return(child.ret); }\
}\
if (require('fs').existsSync('/usr/bin/gsettings'))\
{\
var setting;\
var ids = require('user-sessions').loginUids(); \
for (var i in ids)\
{\
setting = require('linux-gnome-helpers').getProxySettings(ids[i]);\
if (setting.mode == 'manual') { return(setting.host + ':' + setting.port);} \
}\
}\
throw('No Proxy set');\
})();";
#endif