title: Gulp browser-sync - redirect API request via proxy
body: <p>I'm trying to redirect my API requests like this with gulp and browser-sync:</p>
  
  <pre><code>gulp.task('browser-sync', function () {
  
     var files = [
        '../index.html',
        '../views/**/*.html',
        '../assets/css/**/*.css',
        '../assets/js/**/*.js'
     ];
  
     var url = require('url'),
     proxy = require('proxy-middleware');
     var proxyOptions = url.parse('http://localhost:8000/api');
     proxyOptions.route = '/api';
  
     browserSync.init(files, {
        server: {
           baseDir: '..',
           middleware: [proxy(proxyOptions)]
        }
     });
  
  });
  </code></pre>
  
  <p>But I get this response when a call is sent to the API:</p>
  
  <pre><code>Error: connect ECONNREFUSED
      at errnoException (net.js:904:11)
      at Object.afterConnect [as oncomplete] (net.js:895:19)
  </code></pre>
  
  <p>Any idea on what I'm doing wrong?</p>