lamdera/websocket/1.0.0

A Lamdera package. It is not on package.elm-lang.org: the Lamdera compiler provides it, from static.lamdera.com, so lamdera install works and elm install does not.

Websocket

A websocket connection

= ConnectionClosed

Errors that might happen when sending data.

close : Connection -> Task Never ()

Close the websocket connection

createHandle : String -> Task Never Connection

Create a websocket handle that you can then open by calling listen or sendString.

-> (String -> msg)
-> ( { code : CloseEventCode
, reason : String
}
-> msg
)
-> Sub msg

Listen for incoming messages through a websocket connection. You'll also get notified if the connection closes.

sendString : Connection -> String -> Task SendError ()

Send a string

= NormalClosure
| GoingAway
| ProtocolError
| UnsupportedData
| NoStatusReceived
| AbnormalClosure
| InvalidFramePayloadData
| PolicyViolation
| MessageTooBig
| MissingExtension
| InternalError
| ServiceRestart
| TryAgainLater
| BadGateway
| TlsHandshake
| UnknownCode Int

Here are some possible reasons that your websocket connection closed.