diff --git a/httprl.module b/httprl.module
index 55ae23c..3bd2100 100644
--- a/httprl.module
+++ b/httprl.module
@@ -2701,9 +2701,23 @@ function httprl_pr($input) {
  * @return bool
  *   TRUE if a proxy should be used for this host.
  */
+
 function _httprl_use_proxy($host) {
-  $proxy_exceptions = httprl_variable_get('proxy_exceptions', array('localhost', '127.0.0.1'));
-  return !in_array(strtolower($host), $proxy_exceptions, TRUE);
+  // To add a specific domain name in the proxy exception so that all the URL related
+  // to this domain can bypass the proxy e.g. we add drupal.org in exception list then
+  // it can bypass api.drupal.org, groups.drupal.org so even we can get matching pattern.
+  $proxy_exceptions = httprl_variable_get('proxy_exceptions', array('localhost', '127\.0\.0\.1'));
+  $use_proxy = TRUE;
+  if (is_array($proxy_exceptions) && count($proxy_exceptions)) {
+    foreach ($proxy_exceptions as $exception) {
+      $match = preg_match("/{$exception}/is", $host);
+      if ($match) {
+        $use_proxy = FALSE;
+        break;
+      }
+    }
+  }
+  return $use_proxy;
 }
 
 /**
