packages/browser-sync/lib/async.js
function(bs, done) {
        utils.getPorts(bs.options, function(err, port) {
            if (err) {
                return utils.fail(true, err, bs.cb);
            }
            bs.debug("Found a free port: {magenta:%s", port);
            done(null, {
                options: {
                    port: port
                }
            });
        });
    }
function(bs, done) {
        utils.getPorts(bs.options, function(err, port) {
            if (err) {
                return utils.fail(true, err, bs.cb);
            }
            bs.debug("Found a free port: {magenta:%s", port);
            done(null, {
                options: {
                    port: port
                }
            });
        });
    }
function ( bs , done ) { utils . getPorts ( bs . options , function ( err , port ) { if ( err ) { return utils . fail ( true , err , bs . cb ) ; } bs . debug ( "Found a free port: {magenta:%s" , port ) ; done ( null , { options : { port : port } } ) ; } ) ; }
BrowserSync needs at least 1 free port.
It will check the one provided in config
and keep incrementing until an available one is found.
@param {BrowserSync} bs
@param {Function} done
BrowserSync needs at least 1 free port . It will check the one provided in config and keep incrementing until an available one is found .