Draft for supporting WSS (replaces WS, will need re-working)

This commit is contained in:
Tissevert 2019-11-12 17:39:38 +01:00
parent 9fb130c944
commit 00f85651ca
3 changed files with 10 additions and 5 deletions

View File

@ -29,7 +29,9 @@ executable hannah
, hanafuda
, hanafuda-APILanguage
, mtl
, network
, text
, websockets
, wuss
hs-source-dirs: src
default-language: Haskell2010

View File

@ -4,11 +4,13 @@ module Config (
, port
) where
import Network.Socket (PortNumber)
host :: String
host = "koikoi.menf.in"
path :: String
path = "/play/"
port :: Int
port = 80
port :: PortNumber
port = 443

View File

@ -1,14 +1,15 @@
module Main where
import Network.WebSockets (ClientApp, runClient)
import Automaton (start)
import Control.Monad.Reader (runReaderT)
import Control.Monad.State (runStateT)
import Config (host, port, path)
import Automaton (start)
import Network.WebSockets (ClientApp)
import Wuss (runSecureClient)
bot :: ClientApp ()
bot connection = runReaderT Automaton.start connection
main :: IO ()
main =
runClient host port path bot
runSecureClient host port path bot