atomvm_gleam/websocket
Types
Open options. url is required; other fields are optional.
pub type Config {
Config(
url: String,
owner: option.Option(process.Pid),
verify: option.Option(Verify),
network_timeout_ms: option.Option(Int),
disable_auto_reconnect: option.Option(Bool),
)
}
Constructors
-
Config( url: String, owner: option.Option(process.Pid), verify: option.Option(Verify), network_timeout_ms: option.Option(Int), disable_auto_reconnect: option.Option(Bool), )
Errors from the websocket client.
pub type Error {
Failed
NotSupported
Badarg
Timeout
MissingUrl
NotConnected
Other(String)
}
Constructors
-
Failed -
NotSupported -
Badarg -
Timeout -
MissingUrl -
NotConnected -
Other(String)
TLS verification mode.
pub type Verify {
CrtBundle
NoVerify
}
Constructors
-
CrtBundleESP-IDF CA certificate bundle (typical for public
wss://hosts). -
NoVerifyNo verification (development / cleartext
ws://only).
Values
pub fn open(config: Config) -> Result(Websocket, Error)
Open a websocket. Returns once the port exists — wait for connected
before sending.