public HttpServer(HttpServerConfiguration configuration) { _log = LogManager.GetLogger<HttpServer>(); _port = configuration.ServerPort; _listener = new StreamSocketListener(); _listener.ConnectionReceived += ProcessRequestAsync; _contentEncoderFactory = new ContentEncoderFactory(); _messageInspectors = new List<IHttpMessageInspector>(); if (configuration.CorsConfiguration != null) _messageInspectors.Add(new CorsMessageInspector(configuration.CorsConfiguration.AllowedOrigins)); _routes = new SortedSet<RouteRegistration>(configuration.Routes); }
public HttpServer(HttpServerConfiguration configuration) { _log = LogManager.GetLogger <HttpServer>(); _port = configuration.ServerPort; _listener = new StreamSocketListener(); _listener.ConnectionReceived += ProcessRequestAsync; _contentEncoderFactory = new ContentEncoderFactory(); _messageInspectors = new List <IHttpMessageInspector>(); if (configuration.CorsConfiguration != null) { _messageInspectors.Add(new CorsMessageInspector(configuration.CorsConfiguration.AllowedOrigins)); } _routes = new SortedSet <RouteRegistration>(configuration.Routes); }