Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • sbhsadmin Friend
    #193904

    Hello, please can you tell me how to add proxy (squid) support to JA Amazon S3 Component. Our webserver does not have direct access to the Internet.

    Thanks,

    Paul

    Thanh Nguyen Viet Friend
    #519218

    Hello Paul,

    The JA Amazon S3 does not have a settings for Proxy server in current released version, so you need configured it manually with following steps.

    1. Open the file: administrator/components/com_jaamazons3/lib/cloudfusion.2.6/lib/requestcore/requestcore.class.php

    2. Find the code snippet:
    [PHP]if ($this->proxy)
    {
    curl_setopt($curl_handle, CURLOPT_HTTPPROXYTUNNEL, true);

    $host = $this->proxy[‘host’];
    $host .= ($this->proxy[‘port’]) ? ‘:’ . $this->proxy[‘port’] : ”;
    curl_setopt($curl_handle, CURLOPT_PROXY, $host);

    if (isset($this->proxy[‘user’]) && isset($this->proxy[‘pass’]))
    {
    curl_setopt($curl_handle, CURLOPT_PROXYUSERPWD, $this->proxy[‘user’] . ‘:’ . $this->proxy[‘pass’]);
    }
    }[/PHP]
    3. and replacing it with one:
    [PHP]$proxy = array(
    ‘host’ => ‘YOUR_PROXYSERVER_HOST’,
    ‘port’ => ‘YOUR_PROXYSERVER_PORT’,
    ‘user’ => ‘YOUR_PROXYSERVER_USERNAME’,
    ‘pass’ => ‘YOUR_PROXYSERVER_PASSWORD’
    );
    $this->set_proxy($proxy);
    if ($this->proxy)
    {
    curl_setopt($curl_handle, CURLOPT_HTTPPROXYTUNNEL, true);

    $host = $this->proxy[‘host’];
    $host .= ($this->proxy[‘port’]) ? ‘:’ . $this->proxy[‘port’] : ”;
    curl_setopt($curl_handle, CURLOPT_PROXY, $host);

    if (isset($this->proxy[‘user’]) && isset($this->proxy[‘pass’]))
    {
    curl_setopt($curl_handle, CURLOPT_PROXYUSERPWD, $this->proxy[‘user’] . ‘:’ . $this->proxy[‘pass’]);
    }
    }[/PHP]
    Remember to update proxy server info with your own account.

    We will add these settings for our component in the next release.

Viewing 2 posts - 1 through 2 (of 2 total)

This topic contains 2 replies, has 2 voices, and was last updated by  Thanh Nguyen Viet 10 years, 9 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum