|
@@ -10,7 +10,6 @@ export class RPCServer<
|
10
|
10
|
InterfaceT extends T.RPCInterface = T.RPCInterface,
|
11
|
11
|
> {
|
12
|
12
|
|
13
|
|
- private ws = http.createServer()
|
14
|
13
|
private pio = PromiseIO.createServer()
|
15
|
14
|
private visibility: T.Visibility
|
16
|
15
|
private closeHandler: T.CloseHandler
|
|
@@ -28,7 +27,8 @@ export class RPCServer<
|
28
|
27
|
constructor(
|
29
|
28
|
private port: number,
|
30
|
29
|
private exporters: T.ExporterArray<InterfaceT> = [],
|
31
|
|
- conf: T.ServerConf<InterfaceT> = {}
|
|
30
|
+ private conf: T.ServerConf<InterfaceT> = {},
|
|
31
|
+ private ws = http.createServer()
|
32
|
32
|
) {
|
33
|
33
|
if (!conf.visibility) this.visibility = "0.0.0.0"
|
34
|
34
|
|
|
@@ -67,6 +67,8 @@ export class RPCServer<
|
67
|
67
|
\n`+ badRPC.toString() + `
|
68
|
68
|
\n>------------OFFENDING RPC`)
|
69
|
69
|
}
|
|
70
|
+
|
|
71
|
+
|
70
|
72
|
this.startWebsocket()
|
71
|
73
|
}
|
72
|
74
|
|
|
@@ -81,7 +83,8 @@ export class RPCServer<
|
81
|
83
|
this.initRPCs(socket)
|
82
|
84
|
})
|
83
|
85
|
|
84
|
|
- this.pio.listen(this.port)
|
|
86
|
+ if(this.conf.selfStart == null || this.conf.selfStart == true)
|
|
87
|
+ this.pio.listen(this.port)
|
85
|
88
|
|
86
|
89
|
} catch (e) {
|
87
|
90
|
this.errorHandler(this.pio, e, 'system', [])
|