@nestjs/websockets
Version:
WebSockets for NestJS: gateways with message handlers, guards, pipes and interceptors, on Socket.IO or ws.
13 lines (12 loc) • 361 B
JavaScript
import { GATEWAY_SERVER_METADATA } from '../constants.js';
/**
* Attaches native Web Socket Server to a given property.
*
* @publicApi
*/
export const WebSocketServer = () => {
return (target, propertyKey) => {
Reflect.set(target, propertyKey, null);
Reflect.defineMetadata(GATEWAY_SERVER_METADATA, true, target, propertyKey);
};
};