nerf/gun

Low level bindings to the gun API. You typically do not need to use this. Prefer the other modules in this library.

Types

pub external type ConnectionPid
pub type Frame {
  Close
  Text(String)
  Binary(BitString)
}

Constructors

  • Close
  • Text(String)
  • Binary(BitString)
pub external type StreamReference

Functions

pub external fn await_up(
  ConnectionPid,
) -> Result(Dynamic, Dynamic)
pub fn open(
  host: String,
  port: Int,
) -> Result(ConnectionPid, Dynamic)
pub external fn open_erl(
  Charlist,
  Int,
) -> Result(ConnectionPid, Dynamic)
pub fn ws_send(pid: ConnectionPid, frame: Frame) -> Nil
pub external fn ws_upgrade(
  ConnectionPid,
  String,
  List(Header),
) -> StreamReference