@@ -103,7 +103,7 @@ This class represents a WebSocket server. It extends the `EventEmitter`.
103103Create a new server instance. One and only one of ` port ` , ` server `  or ` noServer ` 
104104must be provided or an error is thrown. An HTTP server is automatically created,
105105started, and used if ` port `  is set. To use an external HTTP/S server instead,
106- specify only ` server `  or ` noServer ` . In this case the HTTP/S server must be
106+ specify only ` server `  or ` noServer ` . In this case,  the HTTP/S server must be
107107started manually. The "noServer" mode allows the WebSocket server to be
108108completely detached from the HTTP/S server. This makes it possible, for example,
109109to share a single HTTP/S server between multiple WebSocket servers.
@@ -112,8 +112,8 @@ to share a single HTTP/S server between multiple WebSocket servers.
112112>  authentication in the ` 'upgrade' `  event of the HTTP server. See examples for
113113>  more details.
114114
115- If ` verifyClient `  is not set then the handshake is automatically accepted. If it 
116- has a single parameter then ` ws `  will invoke it with the following argument:
115+ If ` verifyClient `  is not set,  then the handshake is automatically accepted. If
116+ it  has a single parameter,  then ` ws `  will invoke it with the following argument:
117117
118118-  ` info `  {Object}
119119  -  ` origin `  {String} The value in the Origin header indicated by the client.
@@ -124,19 +124,19 @@ has a single parameter then `ws` will invoke it with the following argument:
124124The return value (` Boolean ` ) of the function determines whether or not to accept
125125the handshake.
126126
127- If ` verifyClient `  has two parameters then ` ws `  will invoke it with the following 
128- arguments:
127+ If ` verifyClient `  has two parameters,  then ` ws `  will invoke it with the
128+ following  arguments:
129129
130130-  ` info `  {Object} Same as above.
131131-  ` cb `  {Function} A callback that must be called by the user upon inspection of
132132  the ` info `  fields. Arguments in this callback are:
133133  -  ` result `  {Boolean} Whether or not to accept the handshake.
134-   -  ` code `  {Number} When ` result `  is ` false `  this field determines the HTTP
134+   -  ` code `  {Number} When ` result `  is ` false ` ,  this field determines the HTTP
135135    error status code to be sent to the client.
136-   -  ` name `  {String} When ` result `  is ` false `  this field determines the HTTP
136+   -  ` name `  {String} When ` result `  is ` false ` ,  this field determines the HTTP
137137    reason phrase.
138-   -  ` headers `  {Object} When ` result `  is ` false `  this field determines additional 
139-     HTTP headers to be sent to the client. For example,
138+   -  ` headers `  {Object} When ` result `  is ` false ` ,  this field determines
139+     additional  HTTP headers to be sent to the client. For example,
140140    ` { 'Retry-After': 120 } ` .
141141
142142` handleProtocols `  takes two arguments:
@@ -146,15 +146,15 @@ arguments:
146146-  ` request `  {http.IncomingMessage} The client HTTP GET request.
147147
148148The returned value sets the value of the ` Sec-WebSocket-Protocol `  header in the
149- HTTP 101 response. If returned value is ` false `  the header is not added in the
149+ HTTP 101 response. If returned value is ` false ` ,  the header is not added in the
150150response.
151151
152- If ` handleProtocols `  is not set then the first of the client's requested
152+ If ` handleProtocols `  is not set,  then the first of the client's requested
153153subprotocols is used.
154154
155155` perMessageDeflate `  can be used to control the behavior of [ permessage-deflate
156156extension] [ permessage-deflate ] . The extension is disabled when ` false `  (default
157- value). If an object is provided then that is extension parameters:
157+ value). If an object is provided,  then that is extension parameters:
158158
159159-  ` serverNoContextTakeover `  {Boolean} Whether to use context takeover or not.
160160-  ` clientNoContextTakeover `  {Boolean} Acknowledge disabling of client context
@@ -171,8 +171,8 @@ value). If an object is provided then that is extension parameters:
171171  above this limit will be queued. Default 10. You usually won't need to touch
172172  this option. See [ this issue] [ concurrency-limit ]  for more details.
173173
174- If a property is empty then either an offered configuration or a default value
175- is used. When sending a fragmented message the length of the first fragment is
174+ If a property is empty,  then either an offered configuration or a default value
175+ is used. When sending a fragmented message,  the length of the first fragment is
176176compared to the threshold. This determines if compression is used for the entire
177177message.
178178
@@ -248,7 +248,7 @@ created internally. If an external HTTP server is used via the `server` or
248248` noServer `  constructor options, it must be closed manually. Existing connections
249249are not closed automatically. The server emits a ` 'close' `  event when all
250250connections are closed unless an external HTTP server is used and client
251- tracking is disabled. In this case the ` 'close' `  event is emitted in the next
251+ tracking is disabled. In this case,  the ` 'close' `  event is emitted in the next
252252tick. The optional callback is called when the ` 'close' `  event occurs and
253253receives an ` Error `  if the server is already closed.
254254
@@ -273,7 +273,7 @@ If the upgrade is successful, the `callback` is called with two arguments:
273273
274274-  ` request `  {http.IncomingMessage} The client HTTP GET request.
275275
276- See if a given request should be handled by this server. By default this method
276+ See if a given request should be handled by this server. By default,  this method
277277validates the pathname of the request, matching it against the ` path `  option if
278278provided. The return value, ` true `  or ` false ` , determines whether or not to
279279accept the handshake.
@@ -305,12 +305,12 @@ This class represents a WebSocket. It extends the `EventEmitter`.
305305    tick. To improve compatibility with the WHATWG standard, the default value
306306    is ` false ` . Setting it to ` true `  improves performance slightly.
307307  -  ` finishRequest `  {Function} A function which can be used to customize the
308-     headers of each http  request before it is sent. See description below.
308+     headers of each HTTP  request before it is sent. See description below.
309309  -  ` followRedirects `  {Boolean} Whether or not to follow redirects. Defaults to
310310    ` false ` .
311311  -  ` generateMask `  {Function} The function used to generate the masking key. It
312312    takes a ` Buffer `  that must be filled synchronously and is called before a
313-     message is sent, for each message. By default the buffer is filled with
313+     message is sent, for each message. By default,  the buffer is filled with
314314    cryptographically strong random bytes.
315315  -  ` handshakeTimeout `  {Number} Timeout in milliseconds for the handshake
316316    request. This is reset after every redirection.
@@ -343,7 +343,7 @@ context takeover.
343343
344344for each HTTP GET request (the initial one and any caused by redirects) when it
345345is ready to be sent, to allow for last minute customization of the headers. If
346- ` finishRequest `  is set then it has the responsibility to call ` request.end() ` 
346+ ` finishRequest `  is set,  then it has the responsibility to call ` request.end() ` 
347347once it is done setting request headers. This is intended for niche use-cases
348348where some headers can't be provided in advance e.g. because they depend on the
349349underlying socket.
@@ -479,7 +479,7 @@ The number of bytes of data that have been queued using calls to `send()` but
479479not yet transmitted to the network. This deviates from the HTML standard in the
480480following ways:
481481
482- 1 .  If the data is immediately sent the value is ` 0 ` .
482+ 1 .  If the data is immediately sent,  the value is ` 0 ` .
4834831 .  All framing bytes are included.
484484
485485### websocket.close([ code[ , reason]] )  
@@ -610,7 +610,7 @@ state is `CONNECTING`.
610610
611611### websocket.terminate()  
612612
613- Forcibly close the connection. Internally this calls [ ` socket.destroy() ` ] [ ] .
613+ Forcibly close the connection. Internally,  this calls [ ` socket.destroy() ` ] [ ] .
614614
615615### websocket.url  
616616
@@ -631,12 +631,12 @@ given `WebSocket`.
631631
632632### WS_NO_BUFFER_UTIL  
633633
634- When set to a non  empty value, prevents the optional ` bufferutil `  dependency
634+ When set to a non- empty value, prevents the optional ` bufferutil `  dependency
635635from being required.
636636
637637### WS_NO_UTF_8_VALIDATE  
638638
639- When set to a non  empty value, prevents the optional ` utf-8-validate `  dependency
639+ When set to a non- empty value, prevents the optional ` utf-8-validate `  dependency
640640from being required.
641641
642642## Error codes  
0 commit comments