Browse Source

SYSTEM | Log

pull/1/head
Vitalik 1 year ago
parent
commit
33023ad9ce
  1. 2
      src/domain/real-time/gateways/main.gateway.ts
  2. 6
      src/domain/real-time/guards/jwt.guard.ts

2
src/domain/real-time/gateways/main.gateway.ts

@ -10,7 +10,7 @@ import { JwtWsGuard } from '../guards' @@ -10,7 +10,7 @@ import { JwtWsGuard } from '../guards'
import { WsServerService, WsUsersService } from '../services'
@WebSocketGateway({
transports: ['websocket'],
transports: ['websocket', 'polling'],
cors: {
origin: '*',
},

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

@ -15,9 +15,11 @@ export class JwtWsGuard implements CanActivate { @@ -15,9 +15,11 @@ export class JwtWsGuard implements CanActivate {
const data = context.switchToWs().getData()
try {
const ip = context.switchToWs().getClient()._socket.remoteAddress
const ip = context.switchToWs().getClient()?._socket?.remoteAddress
console.log('ip', ip)
} catch (e) {}
} catch (e) {
console.log(e)
}
const token = this.extractToken(data)

Loading…
Cancel
Save