insite-ws 1.0.351 → 1.0.352
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -9,7 +9,7 @@ import { InSiteWebSocketServerClient } from "./WebSocketServerClient";
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
export class InSiteWebSocketServer extends WebSocketServer {
|
|
12
|
-
constructor(options = {}, props) {
|
|
12
|
+
constructor(options = {}, props, handleListen) {
|
|
13
13
|
const {
|
|
14
14
|
upgrade,
|
|
15
15
|
ssl,
|
|
@@ -30,13 +30,17 @@ export class InSiteWebSocketServer extends WebSocketServer {
|
|
|
30
30
|
throw new Error("WebSocketServer now contains an \"upgrade\" property");
|
|
31
31
|
|
|
32
32
|
if (props)
|
|
33
|
-
|
|
33
|
+
if (typeof props == "function") {
|
|
34
|
+
handleListen = props;
|
|
35
|
+
props = undefined;
|
|
36
|
+
} else
|
|
37
|
+
Object.assign(this, props);
|
|
34
38
|
|
|
35
39
|
this.upgrade = upgrade;
|
|
36
40
|
|
|
37
41
|
this.on("connection", this.#handleConnection);
|
|
38
42
|
|
|
39
|
-
server.listen(port);
|
|
43
|
+
server.listen(port, handleListen);
|
|
40
44
|
|
|
41
45
|
}
|
|
42
46
|
|