nerf/websocket
Types
The URI of the websocket server to connect to
pub type ConnectError {
ConnectionRefused(status: Int, headers: List(Header))
ConnectionFailed(reason: Dynamic)
}
Constructors
-
ConnectionRefused(status: Int, headers: List(Header))
-
ConnectionFailed(reason: Dynamic)
pub opaque type Connection
Functions
pub fn connect(hostname: String, path: String, on port: Int, with headers: List(
#(String, String),
)) -> Result(Connection, ConnectError)
pub fn send_binary(to conn: Connection, this message: BitString) -> Nil
pub fn send_binary_builder(to conn: Connection, this message: BitBuilder) -> Nil
pub fn send_builder(to conn: Connection, this message: StringBuilder) -> Nil