@@ -147,7 +147,8 @@ Default: `'localhost'`
147147
148148Sets the host that the ` WebSocket ` server will listen on. If this doesn't match
149149the host of the server the module is used with, the module may not function
150- properly. If the ` server ` option is defined, this option is ignored.
150+ properly. If the ` server ` option is defined, and the server has been instructed
151+ to listen, this option is ignored.
151152
152153If using the module in a specialized environment, you may choose to specify an
153154` object ` to define ` client ` and ` server ` host separately. The ` object ` value
@@ -181,6 +182,10 @@ module won't function properly. The module will examine the `server` instance
181182passed and if ` server ` _ is an instance of ` https.Server ` , and ` https ` is not
182183already set_ , will set ` https ` to ` true ` .
183184
185+ _ Note: When using a self-signed certificate on Firefox, you must add a "Server
186+ Exception" for ` localhost:{port} ` where ` {port} ` is either the ` port ` or the
187+ ` port.server ` option for secure ` WebSocket ` to work correctly._
188+
184189##### logLevel
185190
186191Type: ` String `
@@ -198,12 +203,21 @@ If true, instructs the internal logger to prepend log output with a timestamp.
198203
199204##### port
200205
201- Type: ` Number `
206+ Type: ` Number|Object `
202207Default: ` 0 `
203208
204209The port the ` WebSocket ` server should listen on. By default, the socket server
205210will allocate a port. If a different port is chosen, the consumer of the module
206- must ensure that the port is free before hand.
211+ must ensure that the port is free before hand. If the ` server ` option is defined,
212+ and the server has been instructed to listen, this option is ignored.
213+
214+ If using the module in a specialized environment, you may choose to specify an
215+ ` object ` to define ` client ` and ` server ` port separately. The ` object ` value
216+ should match ` { client: <Number>, server: <Number> } ` . Be aware that the ` client `
217+ port will be used _ in the browser_ by ` WebSockets ` . You should not use this
218+ option in this way unless _ you know what you're doing._ Using a mismatched
219+ ` client ` and ` server ` port will be ** unsupported by the project** as the behavior
220+ in the browser can be unpredictable and is specific to a particular environment.
207221
208222##### reload
209223
0 commit comments