Browse Source

SYSTEM | Log

pull/1/head
Vitalik 1 year ago
parent
commit
9f5fc17f76
  1. 5
      src/domain/real-time/guards/ws-throtler.guard.ts

5
src/domain/real-time/guards/ws-throtler.guard.ts

@ -5,9 +5,8 @@ import { ThrottlerException, ThrottlerGuard } from '@nestjs/throttler' @@ -5,9 +5,8 @@ import { ThrottlerException, ThrottlerGuard } from '@nestjs/throttler'
export class WsThrottlerGuard extends ThrottlerGuard {
async handleRequest(context: ExecutionContext, limit: number, ttl: number): Promise<boolean> {
const client = context.switchToWs().getClient()
console.log('conn', client.conn)
console.log('socket', client._socket)
const ip = client._socket.remoteAddress
const ip = client.conn.remoteAddress
const key = this.generateKey(context, ip)
const { totalHits } = await this.storageService.increment(key, ttl)
console.log('ip', ip, totalHits)

Loading…
Cancel
Save