Swift Vapor chatting rooms
I'm not new in Swift, but new in Vapor server side development. I'm trying to make simple chat app, using multiple rooms 1:1 using Sockets. I'm able to make single room for multiple connections, but I'm not getting logic how to make rooms 1:1. Should be single socket with routing, or one socket per room, could someone show me example and explain logic please? As client I did simple iOS app, so I'm able to connect to server and able to write messages using single socket.
single socket example
Based on vapor-community chat example, it seems the good practice is one WebSocket per user per room.
Anyway, you can take this repo as an example of a working chat app.
https://github.com/vapor-community/chat-example/