aboutsummaryrefslogtreecommitdiff
path: root/src/Sproxy
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2016-11-28 15:57:23 +0300
committerIgor Pashev <pashev.igor@gmail.com>2016-11-28 15:57:23 +0300
commit1183905204bf70e69a2c853e71efed378f05d0b9 (patch)
tree58ecd9069b66728d88b181ee0bfd379a7ab6fefb /src/Sproxy
parentc28980e5dd731b3d98117c301d2e51cc96c4f867 (diff)
downloadsproxy2-1183905204bf70e69a2c853e71efed378f05d0b9.tar.gz
Apply same settings to redirect server
Diffstat (limited to 'src/Sproxy')
-rw-r--r--src/Sproxy/Server.hs14
1 files changed, 7 insertions, 7 deletions
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)"