on master help sign in
Add getHost/getPort to Warp #233
2a2318eMichael Snoyman
warp/Network/Wai/Handler/Warp.hs+15
@@ -39,6 +39,9 @@ module Network.Wai.Handler.Warp (
39 , setFdCacheDuration
39 , setFdCacheDuration
40 , setBeforeMainLoop
40 , setBeforeMainLoop
41 , setNoParsePath
41 , setNoParsePath
42+ -- ** Getters
43+ , getPort
44+ , getHost
42 -- ** Accessors
45 -- ** Accessors
43 -- | Note: these accessors are deprecated, please use the @set@ versions instead.
46 -- | Note: these accessors are deprecated, please use the @set@ versions instead.
44 , settingsPort
47 , settingsPort
@@ -186,3 +189,15 @@ setBeforeMainLoop x y = y { settingsBeforeMainLoop = x }
186-- Since 2.1.0
189-- Since 2.1.0
187setNoParsePath :: Bool -> Settings -> Settings
190setNoParsePath :: Bool -> Settings -> Settings
188setNoParsePath x y = y { settingsNoParsePath = x }
191setNoParsePath 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 @@
1Name: warp
1Name: warp
2−Version: 2.1.0
2+Version: 2.1.1
3Synopsis: A fast, light-weight web server for WAI applications.
3Synopsis: A fast, light-weight web server for WAI applications.
4License: MIT
4License: MIT
5License-file: LICENSE
5License-file: LICENSE