mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-08 22:53:08 +02:00
13 lines
449 B
TypeScript
13 lines
449 B
TypeScript
import * as websocket from 'websocket';
|
|
import Xev from 'xev';
|
|
import { ParsedUrlQuery } from 'querystring';
|
|
|
|
export default function(request: websocket.request, connection: websocket.connection, subscriber: Xev, user: any): void {
|
|
const q = request.resourceURL.query as ParsedUrlQuery;
|
|
const listId = q.listId as string;
|
|
|
|
// Subscribe stream
|
|
subscriber.on(`user-list-stream:${listId}`, data => {
|
|
connection.send(JSON.stringify(data));
|
|
});
|
|
}
|