(tutorial websocket app from the tutorial https://nbaksalyar.github.io/2015/07/10/writing-chat-in-rust.html)
If you launch it, and then use a javascript app to connect to it, it will establish a connection!
ws = new WebSocket('ws://127.0.0.1:10000');
if (ws.readyState == WebSocket.OPEN) {
console.log('Connection is successful');
}
- Have the rust ecosystem installed on your computer (see https://www.rust-lang.org/en-US/install.html)
- Check out the code src_sh{git clone https://github.com/robotdisco/rust_chat}
cargo build
cargo run
- Launch a browser and use its dev tools to run the code block from the previous section! Enjoy :)