[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: khtml and proxy configuration
From:       Maksim Orlovich <maksim () kde ! org>
Date:       2007-10-29 1:41:24
Message-ID: 200710290143.l9T1h1k6002533 () ms-smtp-01 ! nyroc ! rr ! com
[Download RAW message or body]

Andres Riancho wrote:

> List,
> 
> I'm trying to embed khtml in python, and one of the things that I
> want to do is to change the proxy server that khtml uses to connect to
> the remote sites. 
<snip context>

All the proxy stuff is actually done by kio_http. khtml does not have
network code on its own. The way to enable the proxy is to set 
UseProxy metadata to the proxy URL in the kio_http job.

The code reading the settings (and hence the setting names) is here:
http://lxr.kde.org/source/KDE/kdelibs/kioslave/http/http.cc?v=3.5-branch#279

It seems like you're doing the right thing here, though --- the SlaveConfig
stuff (assuming self.slaveConfig is the KIO::SlaveConfig singleton object)
is supposed to set the default metadata, and KHTML does not touch 
the proxy metadata. 

If your KDE is built w/o NDEBUG, turning on debug area 7113 in kdebugdialog,
and running kdeinit from a terminal (so you can see the output) may also
offer some insight.

If you're working with KDE4, and alternative is the 'startingJob' virtual in
KHTML which can be overriden, to set those sorts of things, but it doesn't
appear to be available in 3.x. 

Sorry that I couldn't be more helpful, but I am seeing this part of KIO for
the first time..

-Maks

> Right now, I'm successfully catching the needConfig 
> signal and handling it this way:
> 
> def configNeeded(self, protocol, host):
> self.slaveConfig.setConfigData(protocol, host, "UserAgent",
> self.UserAgent)
> 
> #self.slaveConfig.setConfigData(protocol, host, "UseProxy", '1')
> self.slaveConfig.setConfigData(protocol, host, "UseProxy",
> 'http://127.0.0.1:8080/')
> self.slaveConfig.setConfigData(protocol, host, "ProxyType", '1')
> self.slaveConfig.setConfigData(protocol, host,
> "PersistentProxyConnection", '0')
> self.slaveConfig.setConfigData(protocol, host,
> "ReversedException", '0')
> 
> self.slaveConfig.setConfigData(protocol, host, "NoProxyFor",
> '1.2.3.4')
> 
> self.slaveConfig.setConfigData(protocol, host, "Proxy",
> 'http://127.0.0.1:8080/')
> self.slaveConfig.setConfigData(protocol, host, "httpProxy",
> 'http://127.0.0.1:8080/')
> self.slaveConfig.setConfigData(protocol, host, "httpsProxy",
> 'http://127.0.0.1:8080/')
> self.slaveConfig.setConfigData(protocol, host, "ProxyHost",
> '127.0.0.1') self.slaveConfig.setConfigData(protocol, host,
> "ProxyPort", '8080')
> 
> With this setConfigData calls, I'm able to set the user agent that
> khtml uses; but the proxy configuration doesn't seem to apply. I have
> read through the kprotocolmanager source code [0] and coudln't
> understand what setConfigData calls I must make in order to instruct
> khtml to ALWAYS use a specified HTTP proxy.
> 
> Could you please help me and specify the variables(like UserAgent,
> UseProxy,etc) I must set to make khtml use an HTTP proxy ? Is there
> any good documentation for this ?
> 
> [0]
> 
[http://www.google.com/codesearch?hl=en&q=+khtml+UserAgent+UseProxy+show:4YigsnRr7Kc:P \
c4znfTNJ6s:xzBvx8xA3VE&sa=N&cd=3&ct=rc&cs_p=http://security.debian.org/debian-security \
/pool/updates/main/k/kdelibs/kdelibs_3.3.2.orig.tar.gz&cs_f=kdelibs-3.3.2/kio/kio/kprotocolmanager.cpp

> 
> Cheers,
> 


 
> > Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic