Emacs behind HTTP proxy

↘锁芯ラ 提交于 2019-11-26 15:14:36

问题


Emacs is able to access the Internet with packages such as url.el or the W3 web browser.

Also, the Emacs Lisp Package Archive is heavily dependent on package url.el.

Now, how do I configure Emacs to use my HTTP proxy to connect to the Internet in general?

Bonus points for any help with ELPA behind a proxy.

Yes, I've had problems with HTTP proxies before.


回答1:


For w3m, this setting has worked for me:

(setq url-proxy-services '(("no_proxy" . "work\\.com")
                           ("http" . "proxy.work.com:911")))



回答2:


I've got authorization working by:

(setq url-proxy-services
   '(("no_proxy" . "^\\(localhost\\|10\\..*\\|192\\.168\\..*\\)")
     ("http" . "proxy.com:8080")
     ("https" . "proxy.com:8080")))

(setq url-http-proxy-basic-auth-storage
    (list (list "proxy.com:8080"
                (cons "Input your LDAP UID !"
                      (base64-encode-string "LOGIN:PASSWORD")))))

Works for Emacs 24.3. It is based on non-public API tricks, so might not work in another Emacs versions...




回答3:


Emacs populates the url-proxy-services variable from the http_proxy, https_proxy and no_proxy environment variables if they are set.



来源:https://stackoverflow.com/questions/1595418/emacs-behind-http-proxy

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!