diff --git a/Refresh.HttpsProxy/Program.cs b/Refresh.HttpsProxy/Program.cs index 9d581a04..0faaa3c8 100644 --- a/Refresh.HttpsProxy/Program.cs +++ b/Refresh.HttpsProxy/Program.cs @@ -23,17 +23,14 @@ // Initialize a Bunkum server for HTTP BunkumServer httpServer = new BunkumHttpServer(loggerConfiguration); -ProxyConfig config = Config.LoadFromJsonFile("proxy.json", httpsServer.Logger); - -httpsServer.Initialize = s => +Action initialize = s => { + ProxyConfig config = Config.LoadFromJsonFile("proxy.json", s.Logger); s.AddMiddleware(new ProxyMiddleware(config)); }; -httpServer.Initialize = s => -{ - s.AddMiddleware(new ProxyMiddleware(config)); -}; +httpsServer.Initialize = initialize; +httpServer.Initialize = initialize; // Start the server in multi-threaded mode, and let Bunkum manage the rest. httpsServer.Start();