This commit is contained in:
Daniel Hübleitner
2019-09-18 02:11:22 +02:00
parent 741c253202
commit 2f32d7c9cd
+6 -6
View File
@@ -224,9 +224,9 @@ export class RPCSocketServer{
socket.on('error', this.conf.errorHandler(socket)) socket.on('error', this.conf.errorHandler(socket))
socket.on('close', this.conf.closeHandler(socket)) socket.on('close', this.conf.closeHandler(socket))
if(this.visibility === "127.0.0.1") if(this.visibility === "127.0.0.1")
this.initApis(socket) this.initRPCs(socket)
else else
this.initPublicApis(socket) this.initPublicRPCs(socket)
}) })
this.wsServer.listen(this.port, this.visibility) this.wsServer.listen(this.port, this.visibility)
}catch(e){ }catch(e){
@@ -235,8 +235,8 @@ export class RPCSocketServer{
} }
} }
protected initApis(socket:Socket){ protected initRPCs(socket:Socket){
const adminRPCs:socketioRPC[] = [ const infoRPC:socketioRPC[] = [
{ {
name: 'info', name: 'info',
type: 'call', type: 'call',
@@ -245,12 +245,12 @@ export class RPCSocketServer{
] ]
const rpcInfos:ExtendedRpcInfo[] = [ const rpcInfos:ExtendedRpcInfo[] = [
...rpcHooker(socket, "Admin", adminRPCs, false), ...rpcHooker(socket, "RPC", infoRPC, false),
...this.rpcExporters.flatMap(exporter => rpcHooker(socket, exporter.name, [...exporter.exportPublicRPCs(), ...exporter.exportRPCs()])) ...this.rpcExporters.flatMap(exporter => rpcHooker(socket, exporter.name, [...exporter.exportPublicRPCs(), ...exporter.exportRPCs()]))
] ]
} }
protected initPublicApis(socket:Socket){ protected initPublicRPCs(socket:Socket){
const adminRPCs:socketioRPC[] = [ const adminRPCs:socketioRPC[] = [
{ {
name: 'info', name: 'info',