Skip to content

Commit 0556f31

Browse files
ttouslpinca
authored andcommitted
[doc] Add TOC to ws.md (#1539)
1 parent aa1dcd5 commit 0556f31

File tree

1 file changed

+51
-7
lines changed

1 file changed

+51
-7
lines changed

doc/ws.md

+51-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,49 @@
11
# ws
22

3+
## Table of Contents
4+
5+
- [Class: WebSocket.Server](#class-websocketserver)
6+
- [new WebSocket.Server(options[, callback])](#new-websocketserveroptions-callback)
7+
- [Event: 'close'](#event-close)
8+
- [Event: 'connection'](#event-connection)
9+
- [Event: 'error'](#event-error)
10+
- [Event: 'headers'](#event-headers)
11+
- [Event: 'listening'](#event-listening)
12+
- [server.address()](#serveraddress)
13+
- [server.clients](#serverclients)
14+
- [server.close([callback])](#serverclosecallback)
15+
- [server.handleUpgrade(request, socket, head, callback)](#serverhandleupgraderequest-socket-head-callback)
16+
- [server.shouldHandle(request)](#servershouldhandlerequest)
17+
- [Class: WebSocket](#class-websocket)
18+
- [Ready state constants](#ready-state-constants)
19+
- [new WebSocket(address[, protocols][, options])](#new-websocketaddress-protocols-options)
20+
- [UNIX Domain Sockets](#unix-domain-sockets)
21+
- [Event: 'close'](#event-close-1)
22+
- [Event: 'error'](#event-error-1)
23+
- [Event: 'message'](#event-message)
24+
- [Event: 'open'](#event-open)
25+
- [Event: 'ping'](#event-ping)
26+
- [Event: 'pong'](#event-pong)
27+
- [Event: 'unexpected-response'](#event-unexpected-response)
28+
- [Event: 'upgrade'](#event-upgrade)
29+
- [websocket.addEventListener(type, listener)](#websocketaddeventlistenertype-listener)
30+
- [websocket.binaryType](#websocketbinarytype)
31+
- [websocket.bufferedAmount](#websocketbufferedamount)
32+
- [websocket.close([code[, reason]])](#websocketclosecode-reason)
33+
- [websocket.extensions](#websocketextensions)
34+
- [websocket.onclose](#websocketonclose)
35+
- [websocket.onerror](#websocketonerror)
36+
- [websocket.onmessage](#websocketonmessage)
37+
- [websocket.onopen](#websocketonopen)
38+
- [websocket.ping([data[, mask]][, callback])](#websocketpingdata-mask-callback)
39+
- [websocket.pong([data[, mask]][, callback])](#websocketpongdata-mask-callback)
40+
- [websocket.protocol](#websocketprotocol)
41+
- [websocket.readyState](#websocketreadystate)
42+
- [websocket.removeEventListener(type, listener)](#websocketremoveeventlistenertype-listener)
43+
- [websocket.send(data[, options][, callback])](#websocketsenddata-options-callback)
44+
- [websocket.terminate()](#websocketterminate)
45+
- [websocket.url](#websocketurl)
46+
347
## Class: WebSocket.Server
448

549
This class represents a WebSocket server. It extends the `EventEmitter`.
@@ -129,20 +173,20 @@ handshake. This allows you to inspect/modify the headers before they are sent.
129173

130174
Emitted when the underlying server has been bound.
131175

132-
### server.clients
133-
134-
- {Set}
135-
136-
A set that stores all connected clients. Please note that this property is only
137-
added when the `clientTracking` is truthy.
138-
139176
### server.address()
140177

141178
Returns an object with `port`, `family`, and `address` properties specifying the
142179
bound address, the address family name, and port of the server as reported by
143180
the operating system if listening on an IP socket. If the server is listening on
144181
a pipe or UNIX domain socket, the name is returned as a string.
145182

183+
### server.clients
184+
185+
- {Set}
186+
187+
A set that stores all connected clients. Please note that this property is only
188+
added when the `clientTracking` is truthy.
189+
146190
### server.close([callback])
147191

148192
Close the HTTP server if created internally, terminate all clients and call

0 commit comments

Comments
 (0)