title: Prevent 504 gateway timeout on overpass api with piped node request
body: <p>I use following code for a OpenStreetMap-query (overpass-API). It works fine on smaller querys but on a bigger one, which takes around 10 min, it generates only a 504 gateway timeout response.</p>
  
  <p><strong>code:</strong>  </p>
  
  <pre><code>var reqStr = "http://overpass.osm.rambler.ru/cgi/interpreter?data=...
  
  console.time("query");
  var stream = request(reqStr,{timeout: 3600000}).on('error', function(err) {
      console.log(err)
  }).pipe(fs.createWriteStream('resultExport.json'));
  stream.on('finish', function () {
      console.timeEnd("query");
  });
  </code></pre>
  
  <p><strong>response (resultExport.json):</strong></p>
  
  <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"&gt;
  &lt;html&gt;&lt;head&gt;
  &lt;title&gt;504 Gateway Time-out&lt;/title&gt;
  &lt;/head&gt;&lt;body&gt;
  &lt;h1&gt;Gateway Time-out&lt;/h1&gt;
  &lt;p&gt;The gateway did not receive a timely response
  from the upstream server or application.&lt;/p&gt;
  &lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>The query command has a <em>[timeout:3600]</em> (seconds) and the request got <em>{timeout: 3600000}</em> (milliseconds). What else can i do prevent the timeout and get a proper response? I am a bit confused where this is coming from.</p>