Browser-sync: Failed to load resource: net::ERR_CONNECTION_CLOSED

Created on 13 Mar 2015  路  7Comments  路  Source: BrowserSync/browser-sync

I'am using gulp for run browser-sync.

var gulp      = require('gulp'),
    browserSync = require("browser-sync");

gulp.task('default', ['browser-sync']);

gulp.task('browser-sync', function() {
    browserSync({
        server: {
            baseDir: "./",
            directory: true
        }
    });
});

but google-chrome push in console

GET https://localhost:3000/browser-sync/socket.io/?EIO=3&transport=polling&t=1426265203441-31 net::ERR_CONNECTION_CLOSED

ver. browser-sync -> 2.2.3

Most helpful comment

Changed socket config, and now works

socket: {
    domain: 'http://localhost:3000'
}

All 7 comments

but Firefox working

if add https param then google chrome working

gulp.task('browser-sync', function() {
    browserSync({
        server: {
            baseDir: "./",
            directory: true,
            https: true
        },
    });
});

You were likely trying to access the url in the first example via https when you had not enabled it.

Happy to re-open this if you can provide a reduced test-case example project that highlights this problem :)

To me, with either https false or undefined, browsersync js tries to connect to https version of the polling url while the page is opened in http

Any update on this issue? I'm facing the same problem. No matter what I try the pooling url is requested under https and it breaks almost every time.

Is there a way to force the livereload to use http instead of https?

Thanks

+1. Switch to https caused many problems in my dev environment. Anyway to use http in Chrome?
Thanks.

Changed socket config, and now works

socket: {
    domain: 'http://localhost:3000'
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

npearson72 picture npearson72  路  3Comments

Hurtak picture Hurtak  路  3Comments

ronilaukkarinen picture ronilaukkarinen  路  4Comments

hgl picture hgl  路  3Comments

ngryman picture ngryman  路  3Comments