summaryrefslogtreecommitdiff
path: root/main/WebSocket.hs
diff options
context:
space:
mode:
Diffstat (limited to 'main/WebSocket.hs')
-rw-r--r--main/WebSocket.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/main/WebSocket.hs b/main/WebSocket.hs
index fbdd65f..7a957e2 100644
--- a/main/WebSocket.hs
+++ b/main/WebSocket.hs
@@ -1,4 +1,5 @@
module WebSocket (
+ WebSocketAddress(..),
startWebsocketServer,
) where
@@ -26,8 +27,10 @@ instance Show WebSocketAddress where
show (WebSocketAddress _ _) = "websocket"
instance PeerAddressType WebSocketAddress where
- sendBytesToAddress (WebSocketAddress _ conn) msg = do
- WS.sendDataMessage conn $ WS.Binary $ BL.fromStrict msg
+ sendBytesToAddress (WebSocketAddress _ conn) msg = do
+ WS.sendDataMessage conn $ WS.Binary $ BL.fromStrict msg
+ connectionToAddressClosed (WebSocketAddress _ conn) = do
+ WS.sendClose conn BL.empty
startWebsocketServer :: Server -> String -> Int -> (String -> IO ()) -> IO ()
startWebsocketServer server addr port logd = do