packages/browser-sync/lib/server/utils.js
function(app, options) {
        return {
            server: (function() {
                var httpModule = serverUtils.getHttpModule(options);

                if (
                    options.get("scheme") === "https" ||
                    options.get("httpModule") === "http2"
                ) {
                    var opts = serverUtils.getHttpsOptions(options);
                    return httpModule.createServer(opts.toJS(), app);
                }

                return httpModule.createServer(app);
            })(),
            app: app
        };
    }
function(app, options) {
        return {
            server: (function() {
                var httpModule = serverUtils.getHttpModule(options);

                if (
                    options.get("scheme") === "https" ||
                    options.get("httpModule") === "http2"
                ) {
                    var opts = serverUtils.getHttpsOptions(options);
                    return httpModule.createServer(opts.toJS(), app);
                }

                return httpModule.createServer(app);
            })(),
            app: app
        };
    }
function ( app , options ) { return { server : ( function ( ) { var httpModule = serverUtils . getHttpModule ( options ) ; if ( options . get ( "scheme" ) === "https" || options . get ( "httpModule" ) === "http2" ) { var opts = serverUtils . getHttpsOptions ( options ) ; return httpModule . createServer ( opts . toJS ( ) , app ) ; } return httpModule . createServer ( app ) ; } ) ( ) , app : app } ; }
Get either http or https server
or use the httpModule provided in options if present
Get either http or https server or use the httpModule provided in options if present