diff --git a/config/config.example.js b/config/config.example.js index 3e0be47c0..4e4ddd46e 100644 --- a/config/config.example.js +++ b/config/config.example.js @@ -74,12 +74,12 @@ module.exports = { // httpSafeOrigin: "https://some-other-domain.xyz", /* httpAddress specifies the address on which the nodejs server - * should be accessible. By default it will listen on 127.0.0.1 - * (IPv4 localhost on most systems). If you want it to listen on - * all addresses, including IPv6, set this to '::'. + * should be accessible. By default it will listen on localhost + * (IPv4 & IPv6 if enabled). If you want it to listen on + * a specific address, specify it here. e.g '192.168.0.1' * */ - //httpAddress: '::', + //httpAddress: 'localhost', /* httpPort specifies on which port the nodejs server should listen. * By default it will serve content over port 3000, which is suitable diff --git a/lib/http-worker.js b/lib/http-worker.js index 5788b63a5..185ae748e 100644 --- a/lib/http-worker.js +++ b/lib/http-worker.js @@ -194,7 +194,8 @@ app.head(/^\/common\/feedback\.html/, function (req, res, next) { const { createProxyMiddleware } = require("http-proxy-middleware"); -var proxyTarget = new URL('', `ws:${Env.httpAddress}`); +var httpAddress = Env.httpAddress === '::' ? 'localhost' : Env.httpAddress; +var proxyTarget = new URL('', `ws:${httpAddress}`); proxyTarget.port = Env.websocketPort; const wsProxy = createProxyMiddleware({