wip
This commit is contained in:
parent
6c495268ae
commit
161fd4afab
37 changed files with 747 additions and 219 deletions
10
src/api/stream/othello.ts
Normal file
10
src/api/stream/othello.ts
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import * as websocket from 'websocket';
|
||||
import * as redis from 'redis';
|
||||
|
||||
export default function(request: websocket.request, connection: websocket.connection, subscriber: redis.RedisClient, user: any): void {
|
||||
// Subscribe othello stream
|
||||
subscriber.subscribe(`misskey:othello-stream:${user._id}`);
|
||||
subscriber.on('message', (_, data) => {
|
||||
connection.send(data);
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue