monkeeShark/src/server/api/stream/drive.ts
2018-07-30 07:20:27 +09:00

9 lines
314 B
TypeScript

import * as websocket from 'websocket';
import Xev from 'xev';
export default function(request: websocket.request, connection: websocket.connection, subscriber: Xev, user: any): void {
// Subscribe drive stream
subscriber.on(`drive-stream:${user._id}`, data => {
connection.send(JSON.stringify(data));
});
}