feat: add getClientAddress to WebSocketAdapter

This commit is contained in:
Ricardo Arturo Cabral Mejía 2022-12-22 21:30:49 -05:00
parent 8e5646d272
commit 081e7de925
2 changed files with 5 additions and 0 deletions

View File

@ -13,6 +13,7 @@ export interface IWebServerAdapter extends EventEmitter {
export type IWebSocketAdapter = EventEmitter & {
getClientId(): string
getClientAddress(): string
getSubscriptions(): Map<string, SubscriptionFilter[]>
}

View File

@ -72,6 +72,10 @@ export class WebSocketAdapter extends EventEmitter implements IWebSocketAdapter
return this.clientId
}
public getClientAddress(): string {
return this.clientAddress
}
public onUnsubscribed(subscriptionId: string): void {
debug('client %s unsubscribed %s', this.clientId, subscriptionId)
this.subscriptions.delete(subscriptionId)