October 12, 2015

Update Joomla 2 Using Proxy

Joomla 2 and below don’t support proxies by default, unfortunately you have to hack the code and remove some files for it to work.

Firstly we need to edit the curl transport file and give it the proxy address. To do this we open libraries/joomla/http/transport/curl.php and look for the following:

// If an explicit timeout is given user it.
if (isset($timeout))
{
        $options[CURLOPT_TIMEOUT] = (int) $timeout;
        $options[CURLOPT_CONNECTTIMEOUT] = (int) $timeout;
}

After that section add the following on a new line, changing the values for the proxy as needed:

$proxy = '10.56.4.1:3128';
curl_setopt($ch, CURLOPT_PROXY, $proxy);

Finally we need to delete the other transport types so it will forcibly use curl with our proxy:

rm libraries/joomla/http/transport/stream.php
rm libraries/joomla/http/transport/socket.php

Renaming these files didn’t seem to work, they have to be removed.

Try updating again now and see if you have a better experience.

Leave a Reply

Your email address will not be published.

css.php