Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yazaldefilimone/sonic.io
real-time communication framework that supports asynchronous and bidirectional (clients servers)
https://github.com/yazaldefilimone/sonic.io
sonic-io websockets
Last synced: about 1 month ago
JSON representation
real-time communication framework that supports asynchronous and bidirectional (clients servers)
- Host: GitHub
- URL: https://github.com/yazaldefilimone/sonic.io
- Owner: yazaldefilimone
- License: mit
- Created: 2023-03-14T18:15:14.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-04-28T19:31:42.000Z (over 1 year ago)
- Last Synced: 2023-12-22T19:30:04.086Z (11 months ago)
- Topics: sonic-io, websockets
- Language: TypeScript
- Homepage:
- Size: 87.9 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sonic.io
O Sonic.io é um framework de comunicação em tempo real de alta performance que suporta a comunicação assíncrona e bidirecional entre clientes e servidor, utilizando a tecnologia de websockets.
#### English:
Sonic.io is a real-time communication framework that supports asynchronous and bidirectional communication between clients and servers, using websocket technology.### Exemples
client:
```ts
import { CreateSonicClient } from 'sonic.io';const sonic = new CreateSonicClient('ws://localhost:3000');
async function main() {
await sonic.connect();await sonic.emit('message', 'Hello, world!');
}main().catch((error) => {
console.error(error);
});```
server:
```ts
import { createServer } from 'http';
import { CreateSonicServer } from 'sonic.io';const httpServer = createServer();
const sonicServer = new CreateSonicServer(httpServer);
async function main() {
await sonicServer.emit('message', 'hello');const room = await sonicServer.to('room-1');
await room.emit('message', 'Hello there!!');
}main().catch((error) => {
console.log(error);
});```