mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-17 13:13:49 +01:00
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)
This commit is contained in:
parent
7107dd682c
commit
1d89dd9d41
@ -69,12 +69,13 @@ function enable() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const port = config.get('port', 9990);
|
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
|
// https://stackoverflow.com/a/62289870
|
||||||
let startFinished = false;
|
let startFinished = false;
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
server.listen(port, "127.0.0.1", () => {
|
server.listen(port, host, () => {
|
||||||
if (!startFinished) {
|
if (!startFinished) {
|
||||||
startFinished = true;
|
startFinished = true;
|
||||||
resolve();
|
resolve();
|
||||||
|
Loading…
Reference in New Issue
Block a user