The 32-byte reconnect token and its 43-character base64url shape were
pinned by hand in both server/main.go and the Dart peer service, and the
supported-version check was spelled out three times in Go. The spec now
carries reconnectTokenBytes and the generator emits the token size,
encoded length, and validator for Dart plus the size and
supportedRelayProtocolVersion for Go, failing before writing either
target when the key is missing. The last handwritten error code in lib/
('not_in_room') uses the generated constant, and releaseSession's
in-flight join is a FutureCoalescer.
48 lines
1.2 KiB
JSON
48 lines
1.2 KiB
JSON
{
|
|
"protocolVersion": 2,
|
|
"legacyProtocolVersion": 0,
|
|
"clientMessageTypes": {
|
|
"create": "create",
|
|
"join": "join",
|
|
"broadcast": "broadcast",
|
|
"sendTo": "sendTo",
|
|
"ping": "ping",
|
|
"leave": "leave",
|
|
"endSession": "endSession",
|
|
"transferHost": "transferHost"
|
|
},
|
|
"serverMessageTypes": {
|
|
"created": "created",
|
|
"joined": "joined",
|
|
"peerJoined": "peerJoined",
|
|
"peerLeft": "peerLeft",
|
|
"message": "message",
|
|
"error": "error",
|
|
"pong": "pong",
|
|
"left": "left",
|
|
"ended": "ended",
|
|
"hostChanged": "hostChanged"
|
|
},
|
|
"errorCodes": {
|
|
"rateLimited": "rate_limited",
|
|
"invalidMessage": "invalid_message",
|
|
"roomExists": "room_exists",
|
|
"roomNotFound": "room_not_found",
|
|
"roomFull": "room_full",
|
|
"notInRoom": "not_in_room",
|
|
"alreadyInRoom": "already_in_room",
|
|
"peerIdUnavailable": "peer_id_unavailable",
|
|
"protocolMismatch": "protocol_mismatch",
|
|
"notHost": "not_host",
|
|
"peerNotFound": "peer_not_found"
|
|
},
|
|
"limits": {
|
|
"maxRoomSize": 8,
|
|
"maxMessageSize": 65536,
|
|
"maxSessionIdLength": 64,
|
|
"maxPeerIdLength": 128
|
|
},
|
|
"idPattern": "^[A-Za-z0-9_-]+$",
|
|
"reconnectTokenBytes": 32
|
|
}
|