Skip to content

a big real time canvas

License

Notifications You must be signed in to change notification settings

ImShyMike/canvas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

cc40bbe · · Aug 31, 2025

History

21 Commits
Aug 19, 2025
Aug 31, 2025
Aug 19, 2025
Aug 27, 2025
Aug 16, 2025
Aug 20, 2025
Aug 16, 2025
Aug 20, 2025

Repository files navigation

A big and fast real time canvas made using Rust and SvelteKit!

Demo image


SDKs

Python

A Python SDK for the custom protocol is available on PyPI with the name "canvas-protocol".

It's source code is located in this repository.

Protocol

The server utilizes a custom data transfer protocol with many custom requests and responses:

Request Types

Name Format (with byte size) Example
SetPixel [type:1][coords:3][rgb:3] = 7 [1][coordinates as u32][rgb as u32]
GetPixel [type:1][coords:3] = 4 [2][rgb as u32]
GetAllPixels [type:1] = 1 [3]
GetStats [type:1] = 1 [4]

Response Types

Name Format (with byte size) Example
SetPixelBroadcast [type:1][coords:3][rgb:3] = 7 [10][coordinates as u32][rgb as u32]
PixelColor [type:1][coords:3][rgb:3] = 7 [10][coordinates as u32][rgb as u32]
Error [type:1][pixels:3*n] = 1 + 3*n [11][rgb as u32]...
GetAllPixels [type:1][rgb:3] = 4 [12][rgb as u32]
Stats [type:1][client_count:2][rps:4] = 7 [13][client count as u16][rps as f32]

Errors

Name Format
InvalidMessageType [1]
OutOfBounds [2]