Browse Source

Allow configuring of bind/listen IP

pull/395/head
BrainStone 4 years ago
parent
commit
0fda3fadfc
No known key found for this signature in database GPG Key ID: 66CCC234C2CEB306
  1. 1
      src/config.js
  2. 5
      src/lib/Server.js

1
src/config.js

@ -3,6 +3,7 @@
const { release } = require('./package.json');
module.exports.RELEASE = release;
module.exports.LISTEN_IP = process.env.LISTEN_IP || '0.0.0.0';
module.exports.PORT = process.env.PORT || 51821;
module.exports.PASSWORD = process.env.PASSWORD;
module.exports.WG_PATH = process.env.WG_PATH || '/etc/wireguard/';

5
src/lib/Server.js

@ -11,6 +11,7 @@ const ServerError = require('./ServerError');
const WireGuard = require('../services/WireGuard');
const {
LISTEN_IP,
PORT,
RELEASE,
PASSWORD,
@ -135,8 +136,8 @@ module.exports = class Server {
return WireGuard.updateClientAddress({ clientId, address });
}))
.listen(PORT, () => {
debug(`Listening on http://0.0.0.0:${PORT}`);
.listen(PORT, LISTEN_IP, () => {
debug(`Listening on http://${LISTEN_IP}:${PORT}`);
});
}

Loading…
Cancel
Save