client library

Swamp Server Dart library

Classes

RawSwampConnection
RoomInfo
Information about a room, including its configuration and state.
SwampClientConnectionInfo
SwampConnection

Enums

CreationFailedReason
JoinFailedReason
KickReason
SwampCommand
Commands sent from the client to the server.
SwampEvent
Events sent from the server to the client.

Extension Types

RoomFlags
Flags configuring the behavior of a room.

Constants

kDefaultSwampSplit → const String
kSwampProtocolPrefix → const String
Prefix used to build WebSocket subprotocol identifiers.
kSwampProtocolVersion → const int
The current Swamp protocol version.
kSwampSchemePrefix → const String
kSwampSupportedProtocols → const List<int>
All protocol versions the library understands.

Functions

decodeRoomCode(String code) Uint8List
Decodes a room code string into its byte array representation.
encodeRoomCode(Uint8List data) String
Encodes a room code (byte array) into a string representation.
parseSwampSubprotocol(String subprotocol) int?
Parses a WebSocket subprotocol string (e.g. swamp-1) and returns the protocol version number, or null if the format is invalid.
swampSubprotocol([int version = kSwampProtocolVersion]) String
Builds the WebSocket subprotocol string for a given version.