diff --git a/src/config.js b/src/config.js index 28c9fc5a..5055c663 100644 --- a/src/config.js +++ b/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/'; diff --git a/src/lib/Server.js b/src/lib/Server.js index f8f380bd..fdcaef0e 100644 --- a/src/lib/Server.js +++ b/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}`); }); }