|
|
|
@ -8,6 +8,7 @@ import {
@@ -8,6 +8,7 @@ import {
|
|
|
|
|
import { Server, Socket } from 'socket.io' |
|
|
|
|
import { JwtWsGuard } from '../guards' |
|
|
|
|
import { WsServerService, WsUsersService } from '../services' |
|
|
|
|
import { WsThrottlerGuard } from '../guards/ws-throtler.guard' |
|
|
|
|
|
|
|
|
|
@WebSocketGateway({ |
|
|
|
|
transports: ['websocket', 'polling'], |
|
|
|
@ -28,6 +29,7 @@ export class MainGateway {
@@ -28,6 +29,7 @@ export class MainGateway {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@UseGuards(JwtWsGuard) |
|
|
|
|
@UseGuards(WsThrottlerGuard) |
|
|
|
|
@SubscribeMessage('join-user') |
|
|
|
|
async onUserConnect(@MessageBody() data, @ConnectedSocket() client: Socket): Promise<void> { |
|
|
|
|
await this.wsUsersService.joinUser(client, data) |
|
|
|
|