Author: chabotc
Date: Wed Jun 25 05:09:04 2008
New Revision: 671521

URL: http://svn.apache.org/viewvc?rev=671521&view=rev
Log:
SHINDIG-329 Add external proxy support for people unlucky enough to live behind 
one

Modified:
    incubator/shindig/trunk/php/config.php
    
incubator/shindig/trunk/php/src/common/samplecontainer/BasicRemoteContentFetcher.php

Modified: incubator/shindig/trunk/php/config.php
URL: 
http://svn.apache.org/viewvc/incubator/shindig/trunk/php/config.php?rev=671521&r1=671520&r2=671521&view=diff
==============================================================================
--- incubator/shindig/trunk/php/config.php (original)
+++ incubator/shindig/trunk/php/config.php Wed Jun 25 05:09:04 2008
@@ -98,6 +98,12 @@
        'cache_time' => 24 * 60 * 60,
        'cache_root' => '/tmp/shindig', 
        
+       // Some people develop living behind a proxy server, setting this to 
your
+       // proxy's url (proxy.mycompany.com) will make curl use that proxy.
+       // On production systems you would not want to do this since it would 
mess up
+       // the refreshInterval and caching policies of shindig
+       'proxy' => '',
+
        // See certs/README on how to generate these keys
        // OAuth private key path
        'private_key_file' => realpath(dirname(__FILE__)) . 
'/certs/private.key', 

Modified: 
incubator/shindig/trunk/php/src/common/samplecontainer/BasicRemoteContentFetcher.php
URL: 
http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/common/samplecontainer/BasicRemoteContentFetcher.php?rev=671521&r1=671520&r2=671521&view=diff
==============================================================================
--- 
incubator/shindig/trunk/php/src/common/samplecontainer/BasicRemoteContentFetcher.php
 (original)
+++ 
incubator/shindig/trunk/php/src/common/samplecontainer/BasicRemoteContentFetcher.php
 Wed Jun 25 05:09:04 2008
@@ -37,6 +37,10 @@
                curl_setopt($request->handle, CURLOPT_TIMEOUT, 20);
                curl_setopt($request->handle, CURLOPT_HEADER, 1);
                curl_setopt($request->handle, CURLOPT_SSL_VERIFYPEER, 0);
+               $proxy = Config::get('proxy');
+               if (!empty($proxy)) {
+                       curl_setopt($request->handle, CURLOPT_PROXY, $proxy);
+               }
                if ($request->hasHeaders()) {
                        $headers = explode("\n", $request->getHeaders());
                        $outHeaders = array();


Reply via email to