https://github.com/ebyte23/collaboration-server
a generic collaboration server for all your needs
https://github.com/ebyte23/collaboration-server
Last synced: about 1 year ago
JSON representation
a generic collaboration server for all your needs
- Host: GitHub
- URL: https://github.com/ebyte23/collaboration-server
- Owner: eByte23
- License: mit
- Created: 2017-02-28T08:21:01.000Z (over 9 years ago)
- Default Branch: dev
- Last Pushed: 2017-04-16T23:55:41.000Z (about 9 years ago)
- Last Synced: 2025-02-13T13:42:41.504Z (over 1 year ago)
- Language: TypeScript
- Size: 56.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# collaboration-server
a generic collaboration server for all your needs
### Usefull notes
```js
// sending to sender-client only
socket.emit('message', "this is a test");
// sending to all clients, include sender
io.emit('message', "this is a test");
// sending to all clients except sender
socket.broadcast.emit('message', "this is a test");
// sending to all clients in 'game' room(channel) except sender
socket.broadcast.to('game').emit('message', 'nice game');
// sending to all clients in 'game' room(channel), include sender
io.in('game').emit('message', 'cool game');
// sending to sender client, only if they are in 'game' room(channel)
socket.to('game').emit('message', 'enjoy the game');
// sending to all clients in namespace 'myNamespace', include sender
io.of('myNamespace').emit('message', 'gg');
// sending to individual socketid
socket.broadcast.to(socketid).emit('message', 'for your eyes only');
```