title: node js https not working behind corporate proxy
body: <pre><code>it always gives :
  Error: getaddrinfo ENOTFOUND &lt;hostname without http or https&gt;
      at errnoException (dns.js:44:10)
      at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:94:26)
  STATUS: undefined
  </code></pre>
  
  <p>My code is as follows:-    </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var Http = require('https');
  var str = "";
  var options = {
      hostname: '&lt;host name without http or https&gt;',
      path: '&lt;path&gt;',
      method: 'POST',
      headers: {
          'Content-Type': 'application/json;charset:utf-8',
          'Content-Length': payload.length,
          'User-Agent': 'Node.js/0.12.7',
          'Proxy-Connections': 'keep-alive'
      }
  };
  
  var req = Http.request(options, function(res) {
      res.setEncoding('utf-8');
      res.on('data', function(response) {
          str += response;
      });
      res.on('end', function() {
          return exits.success(str);
      });
  });
  req.on('error', function(e) {
      console.log('STATUS: ' + e.statusCode);
      exits.error('problem with request: ' + e.message);
  });
  req.write(payload);
  req.end();</code></pre>
  </div>
  </div>
  </p>
  
  <p>I have already tried following:-
   - setting proxy and https-proxy<br>
   - removing http or https from host name</p>
  
  <p>Please help me resolving this issue.</p>