Skip to content

Commit

Permalink
[doc] Clarify interpretation of verifyClient (#1994)
Browse files Browse the repository at this point in the history
Prior to this commit, the documentation for the `verifyClient` option
was somewhat confusing due to its use of the passive voice and an
uncommon interpretation of the term "arguments".

Explain the way `ws` interprets the value of `verifyClient` using an
active voice and more traditional meanings of "parameters" and
"arguments".
  • Loading branch information
jugglinmike authored and lpinca committed Dec 30, 2021
1 parent 00c34d7 commit 5edf1f4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions doc/ws.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ to share a single HTTP/S server between multiple WebSocket servers.
> more details.
If `verifyClient` is not set then the handshake is automatically accepted. If it
is provided with a single argument then that is:
has a single parameter then `ws` will invoke it with the following argument:

- `info` {Object}
- `origin` {String} The value in the Origin header indicated by the client.
Expand All @@ -110,7 +110,8 @@ is provided with a single argument then that is:
The return value (`Boolean`) of the function determines whether or not to accept
the handshake.

if `verifyClient` is provided with two arguments then those are:
If `verifyClient` has two parameters then `ws` will invoke it with the following
arguments:

- `info` {Object} Same as above.
- `cb` {Function} A callback that must be called by the user upon inspection of
Expand Down

0 comments on commit 5edf1f4

Please sign in to comment.