Skip to content

VladlinMoiseenko/websocket-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Websocket Chat Example

README_RUS: Русская версия README.

Implementation in Rust using actix, actix-web, actix-broker

The example is based on chat-broker

  • Chat Server Actor is a System Service that runs in the same thread as the HttpServer/WS Listener.
  • The actix-broker crate is used to facilitate the sending of some messages between the Chat Session and Server Actors where the session does not require a response.
  • The Client is not required to send Ping messages. The Chat Server Actor auto-clears dead sessions.

Server

Chat server listens for incoming tcp connections. Server can access several types of message:

  • /list - list all available rooms
  • /join name - join room, if room does not exist, create new one
  • /name name - set session name
  • some message - just string, send message to all peers in same room

To start server use command:

cd websocket-chat

cargo run

WebSocket Browser Client

Open url: http://localhost:8080/

WebSocket Android Client

Websocket Chat Android Client

Releases

No releases published

Packages

No packages published