Fix ws proxy issue with :: as httpAddress

This commit is contained in:
yflory 2023-12-18 15:47:10 +01:00
parent f9e6c8d142
commit 30d956b52f
2 changed files with 6 additions and 5 deletions

View File

@ -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

View File

@ -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({