如何在经过身份验证的 HTTP 代理后面配置 Emacs?

发布于 2024-09-01 07:29:20 字数 281 浏览 8 评论 0原文

还有另一个问题可以回答这个问题,尽管它没有指定有关代理身份验证的任何内容。

其解法是

(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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

情泪▽动烟 2024-09-08 07:29:20

如今,我解决“经过身份验证的代理问题”的方法是使用 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.

ヅ她的身影、若隐若现 2024-09-08 07:29:20

我在没有用户交互的情况下获得授权工作:

(setq url-proxy-services
   '(("no_proxy" . "^\\(localhost\\|10.*\\)")
     ("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")))))

This work for Emacs 24.3。它基于非公共 API 技巧,因此可能无法在其他 Emacs 版本中工作...

LOGINPASSWORD 替换为您的身份验证信息...

I get authorization working without user interaction by:

(setq url-proxy-services
   '(("no_proxy" . "^\\(localhost\\|10.*\\)")
     ("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")))))

This work for Emacs 24.3. It based on non-public API tricks, so might not work in anther Emacs versions...

Replace LOGIN and PASSWORD with your auth info...

铃予 2024-09-08 07:29:20

好吧,如果您真的想要执行此操作并且不介意使用其他程序,那么... 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.

剪不断理还乱 2024-09-08 07:29:20

万一其他人遇到了我刚刚遇到的问题:

如果您使用 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.

愁杀 2024-09-08 07:29:20

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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文