From 1d89dd9d41600b7091d02d5dcdc3e0159be511ec Mon Sep 17 00:00:00 2001 From: Martin Fournier Date: Wed, 5 Jan 2022 14:15:40 -0500 Subject: [PATCH] Add 'host' config for electron api server Only tweakable through the config, this can allow external access to the server (ie - if running through a VM or WSL) --- electron/api-server.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/electron/api-server.js b/electron/api-server.js index 5de6f2bcb..3a9f06bca 100644 --- a/electron/api-server.js +++ b/electron/api-server.js @@ -69,12 +69,13 @@ function enable() { } const port = config.get('port', 9990); - log.log(`Starting http server on port ${port}`); + const host = config.get('host', '127.0.0.1'); + log.log(`Starting http server on port ${port} - listening on ${host}`); // https://stackoverflow.com/a/62289870 let startFinished = false; return new Promise((resolve, reject) => { - server.listen(port, "127.0.0.1", () => { + server.listen(port, host, () => { if (!startFinished) { startFinished = true; resolve();