I have read this and this question. In both they say Emacs can deal with authentication, but it does not work for me.
The question is: What is wrong?
The Emacs version is 24.0.97-1, and it is running on 64-bit Linux.
At work I have to use proxy server for any Internet connection. So I set the following environment variables:
http_proxy="http://username:password@ip:port"
https_proxy="https://username:password@ip:port"
ftp_proxy="ftp://username:password@ip:port"
This works and I can download packages without any problem.
When I run M-x package-refresh-contents in Emacs it asks me for login and password for the proxy server, but it can not connect to the server. It even does not try to connect, i.e. after I type password and press Enter Emacs instantly reports:
Failed to download 'marmalade' archive
The same happens if I remove username and password from http_proxy variable or if I set url-proxy-services in Emacs (even if I unset the system variable).
It looks like Emacs has some troubles with authentication. So I have installed Squid and now use it as an intermediate between the external proxy server and all my applications. Squid is configured as a proxy without authentication and everything works well with it.
Many people recommend this solution but give no precise instructions. I made my
/etc/squid/squid.conffrom another one designed for different purpose. Probably it contains something that is not needed and/or misses something it should have. Any improvements are welcome:This proxy has address
127.0.0.1:10000. In Emacs I have to execute the following code: