Replying to myself... Just in case if someone has similar problem.
The proxy configuration script did not work because myIpAddress()
incorrectly returned IPv4 localhost address: "127.0.0.1" (in google-
chrome) or IPv6 "::1" (in firefox). I don't know if this is a bug in
myIpAddress(), or the reason was in /etc/hosts file which was
overwritten by NetworkManager as follows:
# Do not remove the following line, or various programs
# that require network functionality will fail.
192.168.1.66 realhostname # Added by NetworkManager
127.0.0.1 localhost.localdomain localhost
::1 realhostname localhost6.localdomain6 localhost6
The workaround is to add the following script in
/etc/NetworkManager/dispatcher.d:
************ cut here **********
#!/bin/sh
export PATH=/sbin:/usr/sbin:$PATH
rewrite_hosts ()
{
tmphosts="/tmp/02-nm-tmp.hosts"
cp /etc/hosts "$tmphosts"
cat "$tmphosts" | sed \
's/^::1\t.*$/::1\tlocalhost6.localdomain6\tlocalhost6/' > /etc/hosts
}
if [ "$2" = "up" ]
then
rewrite_hosts
fi
************ cut here **********
On Tuesday 23 November 2010, Serguei Miridonov wrote:
Hello,
Is there any way to trace how KDE sets proxy from the PAC
configuration file? For me it seems not working...
Here is a sample file proxy_config.pac:
function FindProxyForURL(url, host)
{
if (shExpMatch(url, "https:*")) return "DIRECT";
if (isInNet(host, "127.0.0.0", "255.0.0.0")) return
"DIRECT";
if ( shExpMatch(host, "localhost") ) return "DIRECT";
if ( shExpMatch(host, "localhost.*") ) return "DIRECT";
if ( shExpMatch(host, "127.0.0.*") ) return "DIRECT";
if ( isPlainHostName(host) ) return "DIRECT";
var resolved_ip = dnsResolve(host);
if (isInNet(myIpAddress(),"xxx.xxx.0.0", "255.255.0.0")) {
if (isInNet(resolved_ip, "xxx.xxx.0.0", "255.255.0.0"))
return "DIRECT";
if (dnsDomainIs(host, ".xxx.xx"))
return "DIRECT";
return "PROXY xxx.xxx.xxx.xxx:3128";
}
return "DIRECT";
}
The KDE is set to "Use proxy configuration URL"
file:///home/XXXXX/proxy_config.pac
When at home and I have direct connection to Internet, everything
works. However, when at work and my IP address is within specified
xxx.xxx.0.0 network, I can not see any web page. It seems like KDE
is still set to direct connection but these are blocked by a
firewall, only proxy connections are allowed. KDE (konqueror and
plasma applets) does not even try to connect to proxy server.
Does anybody have the same problem?
Any help would be appreciated.
By the way, testing PAC file with pactester shows no error, so it
seems OK but KDE does something wrong...
System: Fedora 12, KDE 4.4.5.
Thank you.
Serguei.