mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-03-30 22:55:50 +00:00
* example websockets server * example of ws client * type class TConnection for generic TCP/WebSockets implementation * support WebSockets transport * rename TConnection methods * revert runClient to not need transport arg * pass the list of ports and transports via SMP server config * remove TypeApplications * s/Transport/TProxy/, s/TConnection/Transport/ * fix server with multiple transports, make SMP client use WS transport with port 80 (TODO fallback to WS)
20 lines
671 B
Haskell
20 lines
671 B
Haskell
{-# LANGUAGE TypeApplications #-}
|
|
|
|
import AgentTests
|
|
import ProtocolErrorTests
|
|
import ServerTests
|
|
import Simplex.Messaging.Transport (TCP, Transport (..))
|
|
import Simplex.Messaging.Transport.WebSockets (WS)
|
|
import System.Directory (createDirectoryIfMissing, removeDirectoryRecursive)
|
|
import Test.Hspec
|
|
|
|
main :: IO ()
|
|
main = do
|
|
createDirectoryIfMissing False "tests/tmp"
|
|
hspec $ do
|
|
describe "Protocol errors" protocolErrorTests
|
|
describe "SMP server via TCP" $ serverTests (transport @TCP)
|
|
describe "SMP server via WebSockets" $ serverTests (transport @WS)
|
|
describe "SMP client agent" $ agentTests (transport @TCP)
|
|
removeDirectoryRecursive "tests/tmp"
|