code: function (context, run, done) {
          var proxies = run.options.proxies,
              request = context.item.request,
  
              url;
  
          if (!request) { return done(new Error('No request to resolve proxy for.')); }
  
          url = request.url && request.url.toString();
  
          async.waterfall([
              // try resolving custom proxies before falling-back to system proxy
              function (cb) {
                  if (_.isFunction(_.get(proxies, 'resolve'))) {
                      return cb(null, proxies.resolve(url));
                  }
  
                  return cb(null, undefined);
              },
              // fallback to system proxy
              function (config, cb) {
                  if (config) {
                      return cb(null, config);
                  }
  
                  return _.isFunction(run.options.systemProxy) ? run.options.systemProxy(url, cb) : cb(null, undefined);
              }
          ], function (err, config) {
              if (err) {
                  run.triggers.console(context.coords, 'warn', 'proxy lookup error: ' + (err.message || err));
              }
  
              config && (request.proxy = sdk.ProxyConfig.isProxyConfig(config) ? config : new sdk.ProxyConfig(config));
  
              return done();
          });
      }
docs: Proxy lookup