summaryrefslogtreecommitdiffhomepage
path: root/HTTP
diff options
context:
space:
mode:
Diffstat (limited to 'HTTP')
-rw-r--r--HTTP/Server.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/HTTP/Server.hs b/HTTP/Server.hs
index f599c31..fa2e8da 100644
--- a/HTTP/Server.hs
+++ b/HTTP/Server.hs
@@ -19,6 +19,7 @@ import Network.Wai.Handler.Warp
import Control.Monad.IO.Class
import Control.Concurrent
import Control.Concurrent.STM
+import Data.String
import qualified Data.ByteString as B
data ServerState = ServerState
@@ -29,11 +30,14 @@ newServerState :: IO ServerState
newServerState = ServerState
<$> newEmptyTMVarIO
-runServer :: Port -> IO ()
-runServer port = do
+runServer :: String -> Port -> IO ()
+runServer bindaddress port = do
st <- newServerState
_ <- forkIO $ obscurerThread st
- run port (app st)
+ runSettings settings (app st)
+ where
+ settings = setHost host $ setPort port $ defaultSettings
+ host = fromString bindaddress
serverStorage :: Storage
serverStorage = localStorage "server"