Node.js – Live reload fails – Failed to load resource: net::ERR_CONNECTION_REFUSED


I am starting live reload via Gulp:

var $$ = require('gulp-load-plugins')();'*', function (file) {

gulp.task('connect', function(){
  var connect = require('connect');
  return connect()

It had been working until I recently got this cryptic error in the browser console and reload stopped working:

Failed to load resource: net::ERR_CONNECTION_REFUSED

Any idea what happens here?

I am behind proxy but localhost is excluded.

Best Solution

I've been using Browsersync for along time after I had issues with Live-Reload, and here's my setup for Browsersync ...

var browsersync = require('browser-sync'));

//BrowserSync Function
gulp.task('browser-sync', function() {
        // Change the director name for static site
        server: {
            baseDir: "./builds/development"

// Browser Sync reload function
gulp.task('browsersync-reload', function () {

// Server and Watch Function
gulp.task('server', ['browser-sync'], function() {"components/sass/**/*.scss", ['sass']);"html_pages/**/*.html", ['html']);"builds/development/*.html", ['browsersync-reload']);"components/scripts/**/*.js", ['js']);

Hope it helps.

Related Question