title: Node - Request.js ECONNRESET Error Only On Server
body: <p>I have a script on a server that looks like this. </p>
  
  <pre><code>request = require('request');
  require('longjohn');
  request.post(
      { 
          url : 'https://example.com/api/thing/',
          form : {
              api_key : "blahblah",
              thing_id : 0
          },
          json : true
      },
      function(error, response, body){
          console.log(error, response);
      }
  );
  </code></pre>
  
  <p>When i run it locally, It works perfectly, but when I run it on the server i get this. </p>
  
  <pre><code>{ [Error: read ECONNRESET]
  code: 'ECONNRESET',
  errno: 'ECONNRESET',
  syscall: 'read',
  __cached_trace__: 
  [ { receiver: [Object],
     fun: [Function: errnoException],
     pos: 22969 },
   { receiver: [Object], fun: [Function: onread], pos: 14584 },
   {},
   { receiver: [Object], fun: [Function], pos: 19529 },
   { receiver: [Object], fun: [Function], pos: 49346 },
   { receiver: [Object],
     fun: [Function: _tickCallback],
     pos: 14030 },
   { receiver: [Object], fun: [Function], pos: 14031 },
   { receiver: [Object], fun: [Object], pos: 4502 },
   { receiver: [Object], fun: [Function], pos: 28039 },
   {},
   { receiver: [Object], fun: [Function], pos: 48679 },
   { receiver: [Object], fun: [Function], pos: 36057 },
   { receiver: [Object], fun: [Object], pos: 40546 },
   { receiver: [Object], fun: [Function], pos: 3570 },
   { receiver: [Object], fun: [Function], pos: 17260 },
   { receiver: [Object], fun: [Function], pos: 36440 },
   { receiver: [Object], fun: [Function], pos: 11960 },
   {},
   { receiver: [Object], fun: [Function], pos: 11634 },
   { receiver: [Object], fun: [Object], pos: 2292 },
   { receiver: [Object], fun: [Object], pos: 1738 },
   { receiver: [Object], fun: [Function], pos: 3238 },
   { receiver: {}, fun: [Function], pos: 121 },
   { receiver: [Object], fun: [Function], pos: 12854 },
   { receiver: [Object], fun: [Function], pos: 13365 },
   { receiver: [Object], fun: [Function], pos: 10114 } ],
   __previous__: 
   { [Error]
   id: 73,
   location: 'Readable.on (_stream_readable.js:679)',
   __location__: 'EventEmitter.on',
   __previous__: 
    { [Error]
      id: 60,
      location: 'ClientRequest.onSocket (http.js:1700)',
      __location__: 'process.nextTick',
      __previous__: [Object],
      __trace_count__: 2,
      __cached_trace__: [Object] },
   __trace_count__: 3,
   __cached_trace__: 
    [ [Object],
      [Object],
      [Object],
      [Object],
      [Object],
      [Object],
      {},
      [Object],
      [Object],
      [Object],
      [Object],
      [Object],
      [Object],
      [Object],
      {},
      [Object],
      [Object],
      [Object],
      [Object],
      [Object],
      [Object],
      [Object],
      [Object] ] } }
  </code></pre>
  
  <p>I am not familiar with the specifics of tcp sockets. If anyone has any thoughts or if you need more information, let me know.</p>