This is not the most up to date approach to write a chat in Rust, But I'm very hapy that I could run it without any effort, and It still working!!
Greate, but most inpressive is the Rust Class that @nbaksalyar give us
The detailed tutorial is available in a series of blog posts:
- Rust in Detail: Writing Scalable Chat Service from Scratch (**, 한국어, на русском).
- Rust in Detail, Part 2 (на русском).
git clone this or those repository
cargo run
Then the browser and look for the Developer Tools, try to put this code into console.log
ws = new WebSocket('ws://127.0.0.1:10000');
ws.onmessage = function (event) {
console.log('Received response: ', event.data);
};
ƒ (event) {
console.log('Received response: ', event.data);
}
Open two browser to experiment talking to each other
ws.send('Hey there!')