mirror of https://github.com/xwiki-labs/cryptpad
Fix ws proxy issue with :: as httpAddress
This commit is contained in:
parent
f9e6c8d142
commit
30d956b52f
|
@ -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
|
||||
|
|
|
@ -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({
|
||||
|
|
Loading…
Reference in New Issue