1
0
mirror of https://github.com/hotomoe/hotomoe synced 2024-12-27 21:18:05 +09:00
hotomoe/src/api/stream/drive.ts

11 lines
368 B
TypeScript
Raw Normal View History

2017-11-16 23:46:36 +09:00
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 drive stream
subscriber.subscribe(`misskey:drive-stream:${user._id}`);
subscriber.on('message', (_, data) => {
connection.send(data);
});
}