summaryrefslogtreecommitdiff
path: root/src/api/stream/othello.ts
blob: 5056eb535cf9fa07e434a26bba46e56e0d4f6aaf (plain)
1
2
3
4
5
6
7
8
9
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);
	});
}