@@ -4,7 +4,7 @@ const fs = require("fs");
4
4
const path = require ( "path" ) ;
5
5
const crypto = require ( "crypto" ) ;
6
6
const childProcess = require ( "child_process" ) ;
7
- const peer = new Peer ( null , {
7
+ let peer = new Peer ( null , {
8
8
host : ( Object . keys ( JSON . parse ( fs . readFileSync ( path . join ( process . resourcesPath , "customServer.json" ) , "utf8" ) ) ) . length ) ? JSON . parse ( fs . readFileSync ( path . join ( process . resourcesPath , "customServer.json" ) , "utf8" ) ) . peerHostname : process . env . DEFAULT_PEER_SERVER_HOSTNAME ,
9
9
port : ( Object . keys ( JSON . parse ( fs . readFileSync ( path . join ( process . resourcesPath , "customServer.json" ) , "utf8" ) ) ) . length ) ? JSON . parse ( fs . readFileSync ( path . join ( process . resourcesPath , "customServer.json" ) , "utf8" ) ) . peerPort : process . env . DEFAULT_PEER_SERVER_PORT ,
10
10
path : ( Object . keys ( JSON . parse ( fs . readFileSync ( path . join ( process . resourcesPath , "customServer.json" ) , "utf8" ) ) ) . length ) ? JSON . parse ( fs . readFileSync ( path . join ( process . resourcesPath , "customServer.json" ) , "utf8" ) ) . peerPath : process . env . DEFAULT_PEER_SERVER_PATH ,
@@ -318,6 +318,13 @@ window.addEventListener("message", ({ data: { type, deviceId, deviceName, usageD
318
318
type : "debugLogs" ,
319
319
debugLogs
320
320
} ) ;
321
+ } else if ( type === "customServer" ) {
322
+ peer = new Peer ( null , {
323
+ host : ( Object . keys ( JSON . parse ( fs . readFileSync ( path . join ( process . resourcesPath , "customServer.json" ) , "utf8" ) ) ) . length ) ? JSON . parse ( fs . readFileSync ( path . join ( process . resourcesPath , "customServer.json" ) , "utf8" ) ) . peerHostname : process . env . DEFAULT_PEER_SERVER_HOSTNAME ,
324
+ port : ( Object . keys ( JSON . parse ( fs . readFileSync ( path . join ( process . resourcesPath , "customServer.json" ) , "utf8" ) ) ) . length ) ? JSON . parse ( fs . readFileSync ( path . join ( process . resourcesPath , "customServer.json" ) , "utf8" ) ) . peerPort : process . env . DEFAULT_PEER_SERVER_PORT ,
325
+ path : ( Object . keys ( JSON . parse ( fs . readFileSync ( path . join ( process . resourcesPath , "customServer.json" ) , "utf8" ) ) ) . length ) ? JSON . parse ( fs . readFileSync ( path . join ( process . resourcesPath , "customServer.json" ) , "utf8" ) ) . peerPath : process . env . DEFAULT_PEER_SERVER_PATH ,
326
+ secure : ( ( Object . keys ( JSON . parse ( fs . readFileSync ( path . join ( process . resourcesPath , "customServer.json" ) , "utf8" ) ) ) . length ) ? JSON . parse ( fs . readFileSync ( path . join ( process . resourcesPath , "customServer.json" ) , "utf8" ) ) . peerProtocol : process . env . DEFAULT_PEER_SERVER_PROTOCOL ) === "wss:"
327
+ } ) ;
321
328
} ;
322
329
} ) ;
323
330
0 commit comments