From 1183905204bf70e69a2c853e71efed378f05d0b9 Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Mon, 28 Nov 2016 15:57:23 +0300 Subject: Apply same settings to redirect server --- src/Sproxy/Server.hs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/Sproxy') diff --git a/src/Sproxy/Server.hs b/src/Sproxy/Server.hs index 5c80e44..3c34b0c 100644 --- a/src/Sproxy/Server.hs +++ b/src/Sproxy/Server.hs @@ -75,12 +75,18 @@ server configFile = do (\f -> Log.info ("reading key from " ++ f) >> BS.readFile f) (cfKey cf) + let + settings = + (if cfHTTP2 cf then id else setHTTP2Disabled) $ + setOnException (\_ _ -> return ()) + defaultSettings + case maybe80 of Nothing -> return () Just sock80 -> do Log.info "listening on port 80 (HTTP redirect)" listen sock80 maxListenQueue - void . forkIO $ runSettingsSocket defaultSettings sock80 (redirect $ cfListen cf) + void . forkIO $ runSettingsSocket settings sock80 (redirect $ cfListen cf) oauth2clients <- HM.fromList <$> mapM newOAuth2Client (HM.toList (cfOAuth2 cf)) @@ -90,12 +96,6 @@ server configFile = do return (compile $ beName be, be, m) ) $ cfBackends cf - let - settings = - (if cfHTTP2 cf then id else setHTTP2Disabled) $ - setOnException (\_ _ -> return ()) - defaultSettings - -- XXX 2048 is from bindPortTCP from streaming-commons used internally by runTLS. -- XXX Since we don't call runTLS, we listen socket here with the same options. Log.info $ "listening on port " ++ show (cfListen cf) ++ " (HTTPS)" -- cgit v1.2.3