diff --git a/config/config.sample.php b/config/config.sample.php
index f531d5f146b2f80b290fbbed45bf98a9bc4fb361..78dfe17ea790333c722987ac8b8e7980195c52ec 100644
--- a/config/config.sample.php
+++ b/config/config.sample.php
@@ -42,6 +42,12 @@ $CONFIG = array(
 /* Time in seconds how long an user is authenticated without entering his password again before performing sensitive actions like creating or deleting users etc...*/
 "enhancedauthtime" => 15 * 60,
 
+/* A proxy to use to connect to the internet. For example "myproxy.org:88" */
+"proxy" => "",
+
+/* The optional authentication for the proxy to use to connect to the internet. The format is: [username]:[password] */
+"proxyuserpwd" => "",
+
 /* Theme to use for ownCloud */
 "theme" => "",
 
diff --git a/lib/util.php b/lib/util.php
index 4d69f3d86db726f848f47992e581672a88e26075..4170de2125a172da68a85238f37379501f0ad9db 100755
--- a/lib/util.php
+++ b/lib/util.php
@@ -667,34 +667,39 @@ class OC_Util {
          * If not, file_get_element is used.
          */
         
-	public static function getUrlContent($url){
+        public static function getUrlContent($url){
             
-		if  (function_exists('curl_init')) {
-
-			$curl = curl_init();
-
-			curl_setopt($curl, CURLOPT_HEADER, 0);
-			curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
-			curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10);
-			curl_setopt($curl, CURLOPT_URL, $url);
-			curl_setopt($curl, CURLOPT_USERAGENT, "ownCloud Server Crawler");
-			$data = curl_exec($curl);
-			curl_close($curl);
-
-		} else {
-
-			$ctx = stream_context_create(
-					array(
-						'http' => array(
-							'timeout' => 10
-							)
-					     )
-					);
-			$data=@file_get_contents($url, 0, $ctx);
-
-		}
-
-		return $data;
+            if  (function_exists('curl_init')) {
+                
+                $curl = curl_init();
+
+                curl_setopt($curl, CURLOPT_HEADER, 0);
+                curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
+                curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10);
+                curl_setopt($curl, CURLOPT_URL, $url);
+		curl_setopt($curl, CURLOPT_USERAGENT, "ownCloud Server Crawler");
+                if(OC_Config::getValue('proxy','')<>'') {
+			curl_setopt($curl, CURLOPT_PROXY, OC_Config::getValue('proxy'));
+		}
+                if(OC_Config::getValue('proxyuserpwd','')<>'') {
+			curl_setopt($curl, CURLOPT_PROXYUSERPWD, OC_Config::getValue('proxyuserpwd'));
+		}
+                $data = curl_exec($curl);
+                curl_close($curl);
+
+            } else {
+                
+                $ctx = stream_context_create(
+                    array(
+                        'http' => array(
+                            'timeout' => 10
+                        )
+                    )
+                );
+                $data=@file_get_contents($url, 0, $ctx);
+                
+            }
+            return $data;
 	}
         
 }