isProxyRequired = function(hostname) {
  if (!process.env.no_proxy) {
    return true;
  }

  var exclusionPatterns = process.env.no_proxy.split(',');

  for (var i in exclusionPatterns) {
    if (hostname.search(exclusionPatterns[i]) >= 0) {
      return false;
    }
  }

  return true;
}
Returns weather proxy should be used when requesting given host

ie. returns false if hostname match any pattern in no_proxy environment variable