diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-04-24 13:52:03 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-04-24 13:52:03 -0400 |
commit | 82375df3f48246e13e6c9a0c24d937a54d16359a (patch) | |
tree | 1ed19a84b3dac5c90b7d236a25b806c61566d72d | |
parent | a6955dfe76856c8f2a7fb9c136dd014a8adbaea3 (diff) | |
download | debug-me-82375df3f48246e13e6c9a0c24d937a54d16359a.tar.gz |
work around for https://github.com/jaspervdj/websockets/issues/140
-rw-r--r-- | Server.hs | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -82,7 +82,15 @@ closeSession :: Session -> STM () closeSession (Session bchan _ _) = closeTMChan bchan server :: ServerOpts -> IO () -server o = run (serverPort o) . app o =<< newServerState +server o = runSettings settings . app o =<< newServerState + where + settings = + -- Prefer IPv6 but allow IPv4 as well + -- (Workaround for + -- https://github.com/jaspervdj/websockets/issues/140) + setHost "*6" $ + setPort (serverPort o) $ + defaultSettings app :: ServerOpts -> TVar ServerState -> Application app o ssv = websocketsOr WS.defaultConnectionOptions (websocketApp o ssv) webapp |