Search code examples
gulpgulp-watchbrowser-sync

Proxy URL not working with BrowserSync Gulp task


Can someone tell me why my proxy URL isn't working with BrowserSync and Gulp? Instead, it just keeps using http://localhost:3000 as the dev URL.

gulp.task('watch', ['bs'], function() {
  gulp.watch('scss/*.scss', ['scss', browserSync.reload]);
});

gulp.task('bs', function() {
    browserSync.init(['css/style1.css', 'css/style2.css'], {
      proxy: 'dev.site.com'
    });
});

gulp.task('default', ['scss', 'watch']);

Solution

  • I think it works as expected.

    Proxy an EXISTING vhost. BrowserSync will wrap your vhost with a proxy URL to view your site.

    http://www.browsersync.io/docs/options/#option-proxy