Skip to content

Commit

Permalink
expose socket: remoteAddress/remotePort api
Browse files Browse the repository at this point in the history
  • Loading branch information
sequoiar committed May 3, 2020
1 parent 1ca36cd commit 06e8908
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/websocketpp.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,20 @@ class WebSocket extends EventEmitter {
return this._socket && this._socket.address();
}

/**
* @type {String}
*/
get remoteAddress() {
return this._socket && this._socket.remoteAddress;
}

/**
* @type {Number}
*/
get remotePort() {
return this._socket && this._socket.remotePort;
}

/**
* Emit the `'close'` event.
*
Expand Down

0 comments on commit 06e8908

Please sign in to comment.