Enabling proxies for joomla RSS feeds
This is frustrating. Joomla is fantastic, but there are areas that are still very naive and under-coded. Take for example RSS feeds. If you’re behind a proxy, (aka corporate firewall), then you’re out of luck. How do you do it then?
Well, you need to find the file includes/domit/php_http_client_generic.php under your Joomla installation, fire up your favourite editor, (VI — of course
). Now find the following section, (line 542 under Joomla 1.0.13).
function connect() {
if ($this->timeout == 0) {
$this->connection = @fsockopen($this->host, $this->port, $errorNumber, $errorString);
}
else {
$this->connection = @fsockopen($this->host, $this->port, $errorNumber, $errorString, $this->timeout);
}
You will need to change this to something like the following. Change your hostname and port appropriately.
function connect() {
if ($this->timeout == 0) {
$this->connection = @fsockopen("proxy.myhost.com", 3128, $errorNumber, $errorString);
}
else {
$this->connection = @fsockopen("proxy.myhost.com", 3128, $errorNumber, $errorString, $this->timeout);
}
Then that’s it! You’re set! It can be slow at times, so ensure that you are caching XML files in your proxy server.
No related posts.
Categories: Hacking
