title: Node.js request with socks5 agent truncated response
body: <p>Ok, i just don't get it.</p>
  
  <p>Let's say i have some node.js application that makes some get/post request.
  Let's say i also have some socks5 proxy server at localhost:9050.</p>
  
  <p>When i curl the url with the proxy, everything goes well.</p>
  
  <p>But when i try fetching it with http.request, using node-socksified httpAgent to pass requests to socks proxy, response emits "end" event right after receiving first chunk of data.</p>
  
  <p>I've tried another agent implementation with same result. I guess it is somehow connected with node.js dealing with sockets, but i just don't understand what am i doing wrong.</p>
  
  <p>Has someone got same problem?</p>
  
  <p>My code looks something like this:</p>
  
  <pre><code>var options = ...
  
  options.agent = new SocksAgent({
      socks_host : "127.0.0.1",
      socks_port : 9050
  });
  
  var req = http.request(options, function(res) {
  
      res.on("data", function(chunk) {
          console.log(chunk);
      });
  
      res.on("end", function() {
          console.log("end");
      });
  });
  
  req.end();
  </code></pre>