Explorar el Código

allow agent option

Gil Pedersen hace 13 años
padre
commit
edd3726fa3
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      lib/uristream.js

+ 2 - 1
lib/uristream.js

@@ -59,6 +59,7 @@ function setupHttp(uri, options, dst) {
   var timeout = options.timeout || 10*1000;
   var probe = !!options.probe;
   var offset = ~~options.start;
+  var agent = options.agent || null;
 
   var tries = 10;
   if (!probe) defaults['accept-encoding'] = ['gzip','deflate'];
@@ -76,7 +77,7 @@ function setupHttp(uri, options, dst) {
       headers['range'] = 'bytes=' + start + '-';
 
     var accum = 0, size = -1;
-    var req = fetch({uri:uri, headers:headers, timeout:timeout});
+    var req = fetch({uri:uri, headers:headers, agent:agent, timeout:timeout});
     req.on('error', onreqerror);
     req.on('response', onresponse);