/// <summary>
        /// Load all the WebSockets in an assembly.
        /// </summary>
        /// <param name="webserver">The webserver instance.</param>
        /// <param name="assembly">The assembly to load WebSocketsServer types from. Leave null to load from the currently executing assembly.</param>
        /// <returns>An instance of webserver.</returns>
        /// <exception cref="System.ArgumentNullException">webserver.</exception>
        public static IWebServer LoadWebSockets(this IWebServer webserver, Assembly assembly = null)
        {
            if (webserver == null)
            {
                throw new ArgumentNullException(nameof(webserver));
            }

            var types = (assembly ?? Assembly.GetEntryAssembly()).GetTypes();

            foreach (var socketServer in types.Where(x => x.GetTypeInfo().BaseType == typeof(WebSocketsServer)))
            {
                if (webserver.Module <WebSocketsModule>() == null)
                {
                    webserver = webserver.WithWebSocket();
                }

                webserver.Module <WebSocketsModule>().RegisterWebSocketsServer(socketServer);
                $"Registering WebSocket Server '{socketServer.Name}'".Debug(nameof(LoadWebSockets));
            }

            return(webserver);
        }