mirror of
https://github.com/Cameri/nostream.git
synced 2025-08-09 04:31:59 +02:00
feat: add getClientAddress to WebSocketAdapter
This commit is contained in:
@@ -13,6 +13,7 @@ export interface IWebServerAdapter extends EventEmitter {
|
|||||||
|
|
||||||
export type IWebSocketAdapter = EventEmitter & {
|
export type IWebSocketAdapter = EventEmitter & {
|
||||||
getClientId(): string
|
getClientId(): string
|
||||||
|
getClientAddress(): string
|
||||||
getSubscriptions(): Map<string, SubscriptionFilter[]>
|
getSubscriptions(): Map<string, SubscriptionFilter[]>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -72,6 +72,10 @@ export class WebSocketAdapter extends EventEmitter implements IWebSocketAdapter
|
|||||||
return this.clientId
|
return this.clientId
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getClientAddress(): string {
|
||||||
|
return this.clientAddress
|
||||||
|
}
|
||||||
|
|
||||||
public onUnsubscribed(subscriptionId: string): void {
|
public onUnsubscribed(subscriptionId: string): void {
|
||||||
debug('client %s unsubscribed %s', this.clientId, subscriptionId)
|
debug('client %s unsubscribed %s', this.clientId, subscriptionId)
|
||||||
this.subscriptions.delete(subscriptionId)
|
this.subscriptions.delete(subscriptionId)
|
||||||
|
Reference in New Issue
Block a user