Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Main.elm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ view model =
]

wsUrl : String
wsUrl = "ws://localhost:3000"
wsUrl = "wss://localhost:3000"

update : Msg -> Model -> (Model, Cmd Msg)
update msg model =
Expand Down
4 changes: 3 additions & 1 deletion src/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ import qualified Data.Text as Text
import qualified Network.HTTP.Types as Http
import qualified Network.Wai as Wai
import qualified Network.Wai.Handler.Warp as Warp
import qualified Network.Wai.Handler.WarpTLS as WarpTLS
import qualified Network.Wai.Handler.WebSockets as WS
import qualified Network.WebSockets as WS
import qualified Safe

main :: IO ()
main = do
let tlsSettings = WarpTLS.tlsSettings "./localhost.crt" "./localhost.key"
state <- Concurrent.newMVar []
Warp.run 3000 $ WS.websocketsOr
WarpTLS.runTLS tlsSettings Warp.defaultSettings $ WS.websocketsOr
WS.defaultConnectionOptions
(wsApp state)
httpApp
Expand Down
1 change: 1 addition & 0 deletions typesafe-websockets.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ executable typesafe-websockets
, wai
, wai-websockets
, warp
, warp-tls
, websockets
, http-types
, safe