Skip to content

A basic and initial implementation of realtime client for supabase.io, build from scratch using pure websocket protocol.

License

Notifications You must be signed in to change notification settings

julioisaias/realtime-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

realtime-rs

A basic and initial implementation of realtime client for supabase.io written in Rust, build from scratch using pure websocket protocol.

How to use

In the main.rs file you can fill in the following data provided by supabase.io:

let url = "wss://abc.supabase.co";
let api = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.zZaAHGQPi1hZ4nJy5CofZRIP686x_8j5_YzFYwEdWNk";


let client = Client::new(url);
let resp = client.apikey(api).channel("realtime:*");
    resp.connect();

Then run with cargo run. From here you can listen to all the changes made in the cloud database.

Testing

This code can be tested using cargo test to run tests and cargo bench to run bench tests.

Dependencies

Add this to your Cargo.toml:

rand = "0.8.4"
native-tls = "0.2.7"
rustls = "0.19.1"
url = "2.2.2"
base64 = "0.13.0"

Disclaimer

This is not a crate so some functionality may be missing.

Contribution

If you like the project, give it a star, or you can contribute. This is basically that it can help someone who is looking for a solution built from scratch.

License

MIT

About

A basic and initial implementation of realtime client for supabase.io, build from scratch using pure websocket protocol.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages