Browse Source

FIX | GUARD WS

pull/1/head
Vitalik 1 year ago
parent
commit
1303992012
  1. 2
      src/domain/real-time/guards/jwt.guard.ts
  2. 1
      src/domain/real-time/guards/ws-throtler.guard.ts

2
src/domain/real-time/guards/jwt.guard.ts

@ -16,7 +16,7 @@ export class JwtWsGuard implements CanActivate { @@ -16,7 +16,7 @@ export class JwtWsGuard implements CanActivate {
try {
const ip = context.switchToWs().getClient()?.conn?.remoteAddress
console.log('ip', ip)
console.log('WS IP', ip)
} catch (e) {
console.log(e)
}

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

@ -7,6 +7,7 @@ export class WsThrottlerGuard extends ThrottlerGuard { @@ -7,6 +7,7 @@ export class WsThrottlerGuard extends ThrottlerGuard {
try {
const client = context.switchToWs().getClient()
console.log('conn', client.conn)
const ip = client.conn.remoteAddress
const key = this.generateKey(context, ip)
const { totalHits } = await this.storageService.increment(key, ttl)

Loading…
Cancel
Save