如何在经过身份验证的 HTTP 代理后面配置 Emacs?
还有另一个问题可以回答这个问题,尽管它没有指定有关代理身份验证的任何内容。
其解法是
(setq url-proxy-services '(("no_proxy" . "work\\.com")
("http" . "proxy.work.com:911")))
There's another question that answers this though it doesn't specify anything regarding proxy authentication.
Its solution is
(setq url-proxy-services '(("no_proxy" . "work\\.com")
("http" . "proxy.work.com:911")))
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
如今,我解决“经过身份验证的代理问题”的方法是使用 CNTLM。它是可移植的,非常容易配置,并且可以作为守护程序运行。
Nowadays, my approach to the "authenticated proxy problem" is to use CNTLM. It is portable, quite easy to configure and may be run as deamon.
我在没有用户交互的情况下获得授权工作:
This work for Emacs 24.3。它基于非公共 API 技巧,因此可能无法在其他 Emacs 版本中工作...
将
LOGIN
和PASSWORD
替换为您的身份验证信息...I get authorization working without user interaction by:
This work for Emacs 24.3. It based on non-public API tricks, so might not work in anther Emacs versions...
Replace
LOGIN
andPASSWORD
with your auth info...好吧,如果您真的想要执行此操作并且不介意使用其他程序,那么... socat 就是答案。使用 socat 将本地端口转发到通过 http 代理的连接。您并没有绕过它,只是将功能“附加”到不具备该功能的应用程序(以防有人问起)。这可能很难。
如果您使用的是 unixy 操作系统,另一个非常有效的解决方案是安装您自己的使用身份验证代理(如鱿鱼)的非身份验证 http 代理。对于某些人来说,这可能看起来像是一种规避。当心。
例如,查看 Proxytunnel。
更新:Mike Hoss 在他添加到 问题链接到上面。 URL 包将要求输入 ID 和密码。至少这是我在文件 url-http.el 中的 url-http-create-request 的 defun 中看到的。
Well, if you really want to do this and do not mind using another program then ... socat is the answer. Use socat to forward a local port through to a connection passing through the http proxy. You are not bypassing it, just "bolting on" the functionality to an application that does not have it (in case anyone asks). This might be difficult.
Another solution that would work great if you are on a unixy OS is to install your own non-authenticating http proxy that uses the authenticating proxy (like squid). This might look like circumvention to some people. Be careful.
For example, take a look at Proxytunnel.
UPDATE: Mike Hoss seems to be correct in the comment he adds to the question linked to above. The URL package will ask for id and password. At least that is what I see in the defun for url-http-create-request in file url-http.el.
万一其他人遇到了我刚刚遇到的问题:
如果您使用 cntlm 或其他一些本地身份验证代理,您可能需要指定一个环回 IP 地址而不是“localhost”。我发现“localhost”默默地失败了,但“127.0.0.1”却很有效。
In case anyone else hits what I've just struggled with:
If you use cntlm or some other local authenticating proxy, you may need to specify a loopback IP address rather than "localhost". I found "localhost" silently failed, but "127.0.0.1" worked a treat.
ELPA 使用“url”包。据我所知,没有办法用它进行代理身份验证。
您可以在 Emacs 之外设置代理身份验证吗?
ELPA uses the "url" package. As far as I know, there is no way to do proxy authentication with it.
Can you set up your proxy auth outside of Emacs?