Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
aetheon committed Oct 29, 2020
1 parent ddd4187 commit d43796b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions docs/WebSocketServer.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,7 @@ Emitted whenever a new WebSocket connection is accepted.

Whenever a connection is closed for any reason, the WebSocketServer instance will emit a `close` event, passing a reference to the WebSocketConnection instance that was closed. `closeReason` is the numeric reason status code for the connection closure, and `description` is a textual description of the close reason, if available.

### close
`function(webSocketConnection, closeReason, description)`
### upgradeError
`function(error)`

Emitted whenever a WebSocket error happens during the connection upgrade phase. Note that the WS connection is automatically rejected with a 400 error code, this event just exposes the error.
2 changes: 1 addition & 1 deletion lib/WebSocketServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ WebSocketServer.prototype.handleUpgrade = function(request, socket) {
e.headers
);
debug('Invalid handshake: %s', e.message);
this.emit('handshakeError', e);
this.emit('upgradeError', e);
return;
}

Expand Down

0 comments on commit d43796b

Please sign in to comment.