windows - How to configure Atom to use proxy file (pac) settings? -
on windows, possible configure atom use system default proxy instead of manually specifying proxy settings in .apmrc file?
i started using atom-editor windows (windows 7 pro) , far it. i've been searching time try , editor able connect outside world , haven't met success.
our network (i'm not network expert) configured use proxy server (internal) access internet. on system, accomplished in proxy settings 'automatic configuration script', example: http://internal-server-name/sub-dir/file-name.pac
.
many resources have suggested manually setting proxy information in .apmrc file:
- not able connect atom.io themes , packages
- here:https://discuss.atom.io/t/is-there-any-proxy-settings/710/19
- https://github.com/atom/atom/issues/1807
these not answer question need system defaults work
i tried configure atom same thing when change .apmrc file have:
http-proxy = http://internal-server-name/sub-dir/file-name.pac https-proxy = https://internal-server-name/sub-dir/file-name.pac strict-ssl = false
i following error (presumably because above address not proxy itself):
tunneling socket not established, cause=parse error
when leave .apmrc file unmolested, receive following error when trying view packages:
getaddrinfo enotfound
even if had proxy server ip address , port number specify, not not want hard-code credentials in config file i'm pretty sure authentication somehow set use kerberos tokens anyway, wouldn't able specify them @ all.
interestingly atom updates says installed packages (out of box) date, seem indicate portion working while packages , themes not.
here screenshots reference:
no .apmrc changes
proxy server specified in .apmrc
edit 08/31/2015
in response of feedback, tried view .pac file , extract proxy server address information. able information proxy out of file , put in .apmrc file had no affect on outcome (i still receive same errors). have since tried using cntlm no avail.
also note proxy does require authentication stated above. i've been doing further research on issue , may combination of proxy settings apm
, proxy settings github. see following relevant article:
ideally, i'd solution doesn't require complete machine configuration or fragile multi-config file setup.
a .pac
file javascript file browsers can run programmatically determine proxy use. useful if network needs use different proxies access different resources. if open file, you'll able make sense of (it's javascript, after all) , figure out proxy network using general access web. set proxy in .apmrc
file , should work.
things more complicated if proxy requires kind of authentication. if that's problem, let me know. have experience dealing it.
authenticating
ok, need authenticate. situation pretty similar mine. correct in using cntlm, need configure properly. cntlm.ini
file this:
username <your windows username> domain <your domain name> password <leave blank> passlm <get running `cntlm -h` on command line> passnt <get running `cntlm -h` on command line> passntlmv2 <get running `cntlm -h` on command line> proxy <your proxy address ip_address:port> proxy <if have multiple proxies, may list them each on new line> noproxy localhost, 127.0.0.*, <any others should bypass proxy> listen <a local port listen on (i use 53128)>
there's bit funny should know file (cntlm.ini
). when install cntlm, it's included in program's folder work if it's located @ c:\program files (x86)\cntlm\cntlm.ini
. guess it's more accurate should in cntlm
folder inside programfiles
directory should double check case.
anyway, having done that, can start cntlm
(instructions in readme). next, need configure apm
use local proxy. .apmrc
should this:
http-proxy = http://localhost:<port # cntlm.ini> https-proxy = https://localhost:<port # cntlm.ini> strict-ssl = false
you'd think enough there's more might help. had lot of problems npm
until found https
doesn't work through cntlm
needed change registry https://registry.npmjs.org/
http://registry.npmjs.org/
. since apm
uses same registry, decided change too:
apm config set registry http://registry.npmjs.org/
and then... seemed go atom's config.cson
, set core.proxy
http://localhost:<port # cntlm.ini>
and after that, i'd expect things work you. if it's cool , fine , atom working well, there's 1 more thing might want make (all?) other apps (npm, git, etc) work well. on command line, run:
netsh winhttp set proxy localhost:<port # cntlm.ini> "localhost, 127.0.0.*"
this save trouble of configuring (all?) other apps one-by-one. reason, apm
need configured specifically. guess doesn't use winhttp settings reason? don't know answer that.
new info 2016/03/18
i noticed there's 1 additional thing might need apps. should set following environment variables local proxy well:
http_proxy https_proxy ftp_proxy http_proxy https_proxy ftp_proxy
it may seem overkill set both upper , lower case installed msys2 , found looks lower case versions set them , save trouble.
Comments
Post a Comment