diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-11-16 23:46:36 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-11-16 23:46:36 +0900 |
| commit | a8c6d0ed9023f7e0699cfe5c519532231e49cc3b (patch) | |
| tree | 8e467523af5af939ebd6362636c9ba86909b889b /src/api/stream | |
| parent | Fix indentation (diff) | |
| download | sharkey-a8c6d0ed9023f7e0699cfe5c519532231e49cc3b.tar.gz sharkey-a8c6d0ed9023f7e0699cfe5c519532231e49cc3b.tar.bz2 sharkey-a8c6d0ed9023f7e0699cfe5c519532231e49cc3b.zip | |
#465
Diffstat (limited to 'src/api/stream')
| -rw-r--r-- | src/api/stream/drive.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/api/stream/drive.ts b/src/api/stream/drive.ts new file mode 100644 index 0000000000..c97ab80dcc --- /dev/null +++ b/src/api/stream/drive.ts @@ -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 drive stream + subscriber.subscribe(`misskey:drive-stream:${user._id}`); + subscriber.on('message', (_, data) => { + connection.send(data); + }); +} |