feat/add_websocket_support #1

Merged
Aelthorim merged 2 commits from feat/add_websocket_support into main 2026-07-19 12:03:11 +02:00
Owner
No description provided.
- Introduce ConnectionReader and ConnectionWriter async traits to abstract client I/O.
- Move TCP handlers to tcp.rs and WebSocket handlers in ws.rs via tokio-tungstenite.
- Refactor handle_clients to accept any generic type implementing these traits.
- Update main.rs with tokio::select! to handle ports 8000 (TCP) and 8001 (WS) concurrently.
- Introduce generic ConnectionReader<T>/ConnectionWriter<T> traits in
  common, replacing the old non-generic (server-only) versions
- Add server/src/tcp.rs and server/src/ws.rs implementing the traits
  for raw TCP and WebSocket (tokio-tungstenite) respectively; both
  plug into the same handle_clients with no duplicated logic
- Mirror the same split on the client (client/src/tcp.rs, ws.rs),
  parameterized the opposite direction (reads ServerMessage, writes
  ClientMessage)
- Client prompts for tcp/ws at startup and constructs the matching
  reader/writer pair; send/receive/input are now generic over the
  trait and work unchanged regardless of transport
- Fix common's sqlx dependency to actually enable the sqlite feature
  (was previously only enabled in server, causing SqlitePool to be
  unresolved in common's own build)
- Bump version of server, common and client to 0.2.0
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Aelthorim/chat-project!1
No description provided.