title: Error: Protocol:191.168.XXX.XXX: not supported
body: <p>I have this code:</p>
  
  <pre><code>http.get('191.168.XXX.XXX:219/query', function (res) {
      ...
  });
  </code></pre>
  
  <p>The IP is pointed to another machine running node.js too, and redirect to the real file to be downloaded (the check of res.headers.location come after this line). Problem is, even when I can access this IP:port with any browser, node.js just throw a exception:</p>
  
  <pre><code>http.js:1840
      throw new Error('Protocol:' + options.protocol + ' not supported.');
            ^
  Error: Protocol 191.168.XXX.XXX: not supported.
      at Object.exports.request (http.js:1840:11)
      at Object.exports.get (http.js:1840:11)
      at get_link (/home/pi/app.js:XXX:XX)
      at init (/home/pi/app.js:XXX:XX)
      at Object.cb [as oncomplete] (fs.js:168.19)
  </code></pre>
  
  <p>So it seems http.get don t like my address, knowing that I need to call another.</p>
  
  <p>I tried with:</p>
  
  <pre><code>file_url = {
  hostname : 191.168.XXX.XXX,
  port : 219,
  path : 'query'
  };
  </code></pre>
  
  <p>I instead get ECONNREFUSED...</p>
  
  <p>EDIT:</p>
  
  <p>So, after some trial and error with making the url, I ve come to do this:</p>
  
  <pre><code>var link = {
          protocol: 'http:',
          hostname: '191.168.XXX.XXX',
          port: 219,
          path: '/?query'
      };
  http.get(link, function (res) {
      console.log(res.statusCode + ' ' + res.headers.location);
      ...
  });
  </code></pre>
  
  <p>Server side, the code is:</p>
  
  <pre><code>function web (req, res) {
      console.log('Request!');
      var page = url.parse(req.url).pathname,
          query = url.parse(req.url).query;
      console.log(query + ' asked for smil');
      if(page === '/' &amp;&amp; smil[query]) {
          log('ACCEPT', 'Redirecting to ' + smil[query]);
          res.writeHead(302,
              {Location: smil[query]}
          );
          res.end();
      } else { //AUTRE
          console.log('Refusing connection');
          res.writeHead(404, {'Content-Type': 'text/html'});
          res.end();      
      }
  }
  </code></pre>
  
  <p>If I call 191.168.XXX.XXX from my browser, I get redirected or refused correctly if I have valid arguments. But from my client code, I still get ECONNREFUSED before http.get call back.</p>