gleam_gun/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
pub type ConnectionOpts {
Transport(Atom)
TransportOpts(List(ConnectionOptsTransportOpts))
}
Constructors
-
Transport(Atom)
-
TransportOpts(List(ConnectionOptsTransportOpts))
pub type ConnectionOptsTransportOpts {
Verify(Atom)
}
Constructors
-
Verify(Atom)
Functions
pub fn connect(
hostname: String,
path: String,
port: Int,
headers: List(#(String, String)),
opts: List(ConnectionOpts),
) -> Result(Connection, ConnectError)
pub fn send_binary(
to conn: Connection,
this message: BitArray,
) -> Nil
pub fn send_binary_builder(
to conn: Connection,
this message: BytesBuilder,
) -> Nil
pub fn send_builder(
to conn: Connection,
this message: StringBuilder,
) -> Nil