Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to automatic send username/password while using proxy

60 views
Skip to first unread message

Ke Lu

unread,
Aug 22, 2008, 11:29:50 AM8/22/08
to
Hi all,

I use url-retrieve-synchronously function.
But I must use proxy to connect to internet.
So I set url-proxy-services correctly and url-retrieve-synchronously
works ok,But I must input username and password.
How can I automatic send username and password?

Thanks.

Ted Zlatanov

unread,
Aug 22, 2008, 1:24:46 PM8/22/08
to
On Sat, 23 Aug 2008 00:29:50 +0900 Ke Lu <l...@luxdo.jp> wrote:

KL> I use url-retrieve-synchronously function.
KL> But I must use proxy to connect to internet.
KL> So I set url-proxy-services correctly and url-retrieve-synchronously
KL> works ok,But I must input username and password.
KL> How can I automatic send username and password?

Try using auth-sources authentication. From the source commentary:

;; Easy setup:
;; (require 'auth-source)
;; (customize-variable 'auth-sources) ;; optional

;; now, whatever sources you've defined for password have to be available

;; if you want encrypted sources, which is strongly recommended, do
;; (require 'epa-file)
;; (epa-file-mode)
;; (setq epa-file-cache-passphrase-for-symmetric-encryption t) ; VERY important

;; before you put some data in ~/.authinfo.gpg (the default place)

;;; For url-auth authentication (HTTP/HTTPS), you need to use:

;;; machine yourmachine.com:80 port http login testuser password testpass

;;; This will match any realm and authentication method (basic or
;;; digest). If you want finer controls, explore the url-auth source
;;; code and variables.

It's not documented properly yet, but this should get you started.
Basically set up an authinfo file and put the proxy username and
password in it.

Ted

0 new messages