/// <summary> /// Starts this server. /// </summary> public void Start() { var fac = new ServerFactory(); var builder = new AppBuilder(); builder.UseWebSockets(); if (!String.IsNullOrEmpty(Password)) { builder.UseFunc(EnableAuthentication, Password); } builder.UseFunc(WebSocketHandler); builder.UseType<BackgroundsModule>(); builder.UseType<SongsModule>(); var app = Owin.StartupExtensions.Build<AppFunc>(builder); server = fac.Create(app, this.Port); }