Thanks Ducan,<br><br>your answer and Kevin`s answer were really helpfull!<br><br>What I am going to do is to check if the user is using Linux* and In that case I will try to get the proxy settings from http_proxy environment variable or from gconf or from  kioslaverc. And if everything fail I will ask the user to provided the correct proxy settings (I think this is a fair solution because on one hand I think most linux users know what a proxy is and on the other hand at least I tried to get things easier for them :-) )<br>

<br>Probably I will download a KDE distribution to test my code or at least I will find someone using KDE (and willing to do a test for me).<br><br>* (I use a python library call mechanize, in Windows and Mac OsX, this library reads the proxy setting from windows registry and some MacOsX registry)<br>


<br><br><div class="gmail_quote">On Fri, Sep 9, 2011 at 8:50 PM, Duncan <span dir="ltr"><<a href="mailto:1i5t5.duncan@cox.net">1i5t5.duncan@cox.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Kevin Krammer posted on Fri, 09 Sep 2011 17:58:53 +0200 as excerpted:<br>
<div class="im"><br>
> On Friday, 2011-09-09, Osvaldo Martin wrote:<br>
>> Hi,<br>
>><br>
>> Googling kioslaverc I found that there is a command to read from that<br>
>> file, in order to extract the http proxy settings I should use this<br>
>> command:<br>
>><br>
>> "kreadconfig --file kioslaverc --group Proxy\ Settings --key httpproxy"<br>
>><br>
>> this will return the http host and the port, If the user is ussing and<br>
>> authentication proxy conecction it will give also the username and<br>
>> password?<br>
><br>
> I guess so.<br>
<br>
</div>@Osvaldo:  Please followup inline /under/ the part of the message you are<br>
replying to, thus maintaining the context.  It makes further followups<br>
/much/ easier. =:^)<br>
<br>
As with Kevin, I don't authenticate to my (localhost-only, personal)<br>
proxy, so can't confirm the username/password bit.  But, some more to<br>
add...<br>
<br>
"IMPORTANT*: That should be --key httpProxy (case sensitive, uppercase P<br>
on proxy), or it returns nothing.  See below.<br>
<div class="im"><br>
>> It this command available by default or require the installation some<br>
>> extra package?<br>
><br>
> Yes, kreadconfig is part of all KDE installations.<br>
<br>
</div>FWIW, here on Gentoo, the kreadconfig binary is part of the kreadconfig<br>
package, which is a dependency of the kdebase-startkde package.<br>
<br>
What that means "in plain English" is that it will be installed as part of<br>
the infrastructure for actually starting a kde session.  So anyone running<br>
a kde session should have it installed (at least on Gentoo), but not<br>
necessarily anyone simply running a kde app on some OTHER X session<br>
(gnome, xfce, whatever), since it's not included in or a dependency of<br>
kdelibs, a dependency on which is (by some practical definition at least)<br>
what makes a kde app.<br>
<br>
It's also worth noting that kde's config (as read by kreadconfig) is a<br>
composition of data from several locations.  Normally, there will be at<br>
least two config locations, one each in $KDEHOME and $KDEDIRS (with<br>
appropriate defaults for each if they aren't set, often $HOME/.kde/ and<br>
/usr/share/, but a distro may have other defaults), with the possibility<br>
of config files in either or both locations.  It's thus possible for a<br>
sysadmin to have a kioslaverc file at /usr/share/config/kioslaverc that<br>
would contain settings for all users, that would be read first, so the<br>
user settings (if present and if a value hasn't been set to prevent it)<br>
override the system settings.<br>
<br>
kreadconfig combines the data from all the files in all locations in the<br>
appropriate stack-order, so the data read is the same as if a kde app was<br>
reading it using (presumably) kdelibs functionality.  It's thus a MUCH<br>
more appropriate way of reading the config, than to try to read it<br>
directly from the config files yourself, even if it doesn't interpret what<br>
it returns, that's upto the script/app calling it.<br>
<br>
The caveat is that for kde apps installed alone, not with the<br>
infrastructure necessary to run an entire kde session, kreadconfig might<br>
not be available.<br>
<div class="im"><br>
> However it only returns a value from a config file, it does not<br>
> interpret the config.<br>
<br>
</div>Here's my user config kioslaverc here; no system kioslaverc (and the user<br>
one is $HOME/kde/share/config/kioslaverc , no leading dot-dir, as I<br>
dislike hidden major config dirs so set $KDEHOME appropriately,<br>
NoProxyFor and the httpProxy port slightly obfuscated)<br>
<br>
-----------------8><------------------<br>
AutoResume=true ConnectTimeout=20<br>
PersistentProxyConnection=true<br>
ProxyConnectTimeout=20<br>
ReadTimeout=20<br>
ResponseTimeout=40<br>
<br>
[$Version]<br>
update_info=kioslave.upd:kde2.2/r1,kioslave.upd:kde2.2/r3,kioslave.upd:kde2.2/r2<br>
<br>
[Browser Settings/SMBro]<br>
Encoding=iso 8859-1<br>
Password=<br>
ShowHiddenShares=false<br>
User=<br>
Workgroup=<br>
<br>
[Proxy Settings]<br>
AuthMode=0<br>
MaxCacheSize=5120<br>
NoProxyFor=aa,bb,cc,dd,192.168.aaa.bbb,<a href="http://aaa.com" target="_blank">aaa.com</a>,<a href="http://www.sample.com" target="_blank">www.sample.com</a>,192.168.aaa.ccc<br>
Proxy Config Script=<br>
ProxyType=1<br>
ReversedException=false<br>
UseCache=false<br>
cache=Reload<br>
ftpProxy=<br>
httpProxy=http://localhost:nnnn<br>
httpsProxy=<br>
-----------------><8------------------<br>
<br>
Given that config ($>> indicates my shell prompt):<br>
<br>
$>>kreadconfig --file kioslaverc --group "Proxy Settings" --key httpproxy<br>
<br>
$>>kreadconfig --file kioslaverc --group "Proxy Settings" --key httpProxy<br>
http://localhost:nnnn<br>
$>><br>
<br>
<br>
Note both the quoting of "Proxy Settings" so it is passed by the shell<br>
as a single parameter, and that the whole thing is case sensitive<br>
(httpproxy as the key returned nothing, neither would "proxy settings"<br>
as the group, or KIOSlaverc, since in each case that refers to an<br>
entirely different and here non-existing object).<br>
<font color="#888888"><br>
--<br>
Duncan - List replies preferred.   No HTML msgs.<br>
"Every nonfree program has a lord, a master --<br>
and if you use the program, he is your master."  Richard Stallman<br>
</font><div><div></div><div class="h5"><br>
___________________________________________________<br>
This message is from the kde mailing list.<br>
Account management:  <a href="https://mail.kde.org/mailman/listinfo/kde" target="_blank">https://mail.kde.org/mailman/listinfo/kde</a>.<br>
Archives: <a href="http://lists.kde.org/" target="_blank">http://lists.kde.org/</a>.<br>
More info: <a href="http://www.kde.org/faq.html" target="_blank">http://www.kde.org/faq.html</a>.<br>
</div></div></blockquote></div><br>