title: Error: connect ECONNREFUSED
body: <p>This is my node server: </p>
  
  <pre><code>var https = require('https'),
      http = require('http'),
      qs = require('querystring'),
      request = require('request'),
      username = 'user',
      password = 'pass',
  
  colors = require('colors'),
  
  port = 6969;
  
  function onRequest(client_req, client_res) {
      var query = client_req.url.substring(1);
  
      console.log("proxying " + client_req.url);
  
      var options = {
          host: 'http://'+username + ':' + password + '@site.subs.com',
          port: 443,
          path: '/api/v1/subs/?lang=it&amp;format=html' + query,
          method: 'GET',
          gzip:true,
          headers: {
              accept: '*/*'
          }
      };
  
      var connector = https.request(options, function (res) {
          res.pipe(client_res, {end: true});//tell 'response' end=true
          console.log(res);
      });
  
      // Website you wish to allow to connect
      client_res.setHeader('Access-Control-Allow-Origin', 'http://localhost:3000');
  
      // Request methods you wish to allow
      client_res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');
  
      // Request headers you wish to allow
      client_res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type');
  
      // Set to true if you need the website to include cookies in the requests sent
      // to the API (e.g. in case you use sessions)
      client_res.setHeader('Access-Control-Allow-Credentials', true);
  
      client_req.pipe(connector, {end: true});
  
      console.log(connector);
  
  }
  
  http.createServer(onRequest).listen(port);
  
  process.on('uncaughtException', function (err) {
      console.log(err);
  });
  </code></pre>
  
  <p>Im trying to authenticate in a basic auth by using the basic sintax " <em>host: 'http://'+username + ':' + password + '@site.subs.com'</em> " but i get this error: <strong>Error: connect ECONNREFUSED</strong> followed by ip and port.</p>
  
  <p>what do i do wrong?</p>