on master help sign in
Add getHost/getPort to Warp #233
commit2a2318e274c83bb8b0db05f0995962708f86964a authorMichael Snoyman <michael@snoyman.com> dateTue 11 Mar 2014, 09:25 (13 years ago) parent129b332
2 files changed+16−1
warp/Network/Wai/Handler/Warp.hs+15 warp/warp.cabal+1−1
warp/Network/Wai/Handler/Warp.hs+15
@@ -39,6 +39,9 @@ module Network.Wai.Handler.Warp (
3939 , setFdCacheDuration
4040 , setBeforeMainLoop
4141 , setNoParsePath
42+ -- ** Getters
43+ , getPort
44+ , getHost
4245 -- ** Accessors
4346 -- | Note: these accessors are deprecated, please use the @set@ versions instead.
4447 , settingsPort
@@ -186,3 +189,15 @@ setBeforeMainLoop x y = y { settingsBeforeMainLoop = x }
186189-- Since 2.1.0
187190setNoParsePath :: Bool -> Settings -> Settings
188191setNoParsePath x y = y { settingsNoParsePath = x }
192+
193+-- | Get the listening port.
194+--
195+-- Since 2.1.1
196+getPort :: Settings -> Int
197+getPort = settingsPort
198+
199+-- | Get the interface to bind to.
200+--
201+-- Since 2.1.1
202+getHost :: Settings -> HostPreference
203+getHost = settingsHost
warp/warp.cabal+1−1
@@ -1,5 +1,5 @@
11Name: warp
2−Version: 2.1.0
2+Version: 2.1.1
33Synopsis: A fast, light-weight web server for WAI applications.
44License: MIT
55License-file: LICENSE