title: Socket hangup while posting request to Node-http-proxy Node.js
body: <p>I'm working in Node.js Project and I want node to act as a proxy for solr</p>
  
  <p>For proxy: I used <a href="https://github.com/nodejitsu/node-http-proxy" rel="noreferrer">Node-http-proxy</a>.
  the problem is that proxy work excellent in case of get requests but in case of post requests it results in socket hang up exception </p>
  
  <p>Here is a sample of my node code</p>
  
  <pre><code>var express = require('express');
  var router = express.Router();
  
  var http = require('http');
  var httpProxy = require('http-proxy')
  
  var proxyOptions = {
    host: "127.0.0.1",
    port: 8983
  };
  var proxy = httpProxy.createProxyServer(proxyOptions);
  
  // It works excellent in GET request
  router.get('/solr/*', function(req, res) {
    proxy.web(req, res, {
      target: 'http://' + proxyOptions.host + ':' + proxyOptions.port
    });
  })
  
  // the socket hang up in post request
  router.post('/solr/*', function(req, res) {
    console.log('Post Request');
    proxy.web(req, res, {
      target: 'http://' + proxyOptions.host + ':' + proxyOptions.port
    });
  })
  </code></pre>
  
  <p>And this is the error after some time in node console</p>
  
  <pre><code>Error: socket hang up
      at createHangUpError (http.js:1476:15)
      at Socket.socketOnEnd [as onend] (http.js:1572:23)
      at Socket.g (events.js:180:16)
      at Socket.emit (events.js:117:20)
      at _stream_readable.js:943:16
      at process._tickCallback (node.js:419:13)
  </code></pre>
  
  <p>Any suggestions about the cause of the problem </p>