From fd63e02ff58ed7e3ab2dcb84a36f0d49c1d553a2 Mon Sep 17 00:00:00 2001 From: Anshuman Verma Date: Mon, 21 Jun 2021 22:34:55 +0530 Subject: [PATCH] fix: rename `path` to `pathname` for `client.webSocketURL` (#3466) --- README.md | 2 +- bin/cli-flags.js | 4 ++-- lib/options.json | 2 +- lib/utils/DevServerPlugin.js | 14 ++++++++------ lib/utils/normalizeOptions.js | 2 +- .../validate-options.test.js.snap.webpack4 | 10 +++++----- .../validate-options.test.js.snap.webpack5 | 10 +++++----- .../__snapshots__/basic.test.js.snap.webpack4 | 2 +- .../__snapshots__/basic.test.js.snap.webpack5 | 2 +- test/cli/client-option.test.js | 9 ++++++--- .../web-socket-server-url.test.js.snap.webpack4 | 16 ++++++++-------- .../web-socket-server-url.test.js.snap.webpack5 | 16 ++++++++-------- test/e2e/web-socket-server-url.test.js | 10 +++++----- .../normalizeOptions.test.js.snap.webpack4 | 4 ++-- .../normalizeOptions.test.js.snap.webpack5 | 4 ++-- test/server/utils/normalizeOptions.test.js | 4 ++-- test/validate-options.test.js | 14 +++++++++----- 17 files changed, 67 insertions(+), 58 deletions(-) diff --git a/README.md b/README.md index ab0958c166..a63f2b8445 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,7 @@ Options: --client-web-socket-url Allows to specify URL to web socket server (useful when you're proxying dev server and client script does not always know where to connect to). --client-web-socket-url-hostname Tells clients connected to devServer to use the provided host. - --client-web-socket-url-path Tells clients connected to devServer to use the provided path to connect. + --client-web-socket-url-pathname Tells clients connected to devServer to use the provided path to connect. --client-web-socket-url-port Tells clients connected to devServer to use the provided port. --client-web-socket-url-protocol Tells clients connected to devServer to use the provided protocol. --compress Enables gzip compression for everything served. https://webpack.js.org/configuration/dev-server/#devservercompress diff --git a/bin/cli-flags.js b/bin/cli-flags.js index 5edba48606..704ade8d8a 100644 --- a/bin/cli-flags.js +++ b/bin/cli-flags.js @@ -237,14 +237,14 @@ module.exports = { simpleType: 'string', multiple: false, }, - 'client-web-socket-url-path': { + 'client-web-socket-url-pathname': { configs: [ { type: 'string', multiple: false, description: 'Tells clients connected to devServer to use the provided path to connect.', - path: 'client.webSocketURL.path', + path: 'client.webSocketURL.pathname', }, ], description: diff --git a/lib/options.json b/lib/options.json index 245d5f2df4..0dd66202c4 100644 --- a/lib/options.json +++ b/lib/options.json @@ -150,7 +150,7 @@ "type": "string", "minLength": 1 }, - "path": { + "pathname": { "description": "Tells clients connected to devServer to use the provided path to connect.", "type": "string" }, diff --git a/lib/utils/DevServerPlugin.js b/lib/utils/DevServerPlugin.js index a21e786769..4107a3ea63 100644 --- a/lib/utils/DevServerPlugin.js +++ b/lib/utils/DevServerPlugin.js @@ -87,11 +87,11 @@ class DevServerPlugin { } /** @type {string} */ - let path = ''; + let pathname = ''; - // We are proxying dev server and need to specify custom `path` - if (typeof options.client.webSocketURL.path !== 'undefined') { - path = options.client.webSocketURL.path; + // We are proxying dev server and need to specify custom `pathname` + if (typeof options.client.webSocketURL.pathname !== 'undefined') { + pathname = options.client.webSocketURL.pathname; } // Web socket server works on custom `path` @@ -99,7 +99,7 @@ class DevServerPlugin { typeof options.webSocketServer.options.prefix !== 'undefined' || typeof options.webSocketServer.options.path !== 'undefined' ) { - path = + pathname = options.webSocketServer.options.prefix || options.webSocketServer.options.path; } @@ -132,7 +132,9 @@ class DevServerPlugin { username || password ? `@` : '' }${ipaddr.IPv6.isIPv6(hostname) ? `[${hostname}]` : hostname}${ port ? `:${port}` : '' - }${path || '/'}${searchParamsString ? `?${searchParamsString}` : ''}` + }${pathname || '/'}${ + searchParamsString ? `?${searchParamsString}` : '' + }` ).toString() ).replace( /[!'()*]/g, diff --git a/lib/utils/normalizeOptions.js b/lib/utils/normalizeOptions.js index c6807308cb..47a44db2c7 100644 --- a/lib/utils/normalizeOptions.js +++ b/lib/utils/normalizeOptions.js @@ -126,7 +126,7 @@ function normalizeOptions(compiler, options, logger, cacheDir) { protocol: parsedURL.protocol, hostname: parsedURL.hostname, port: parsedURL.port.length > 0 ? Number(parsedURL.port) : '', - path: parsedURL.pathname, + pathname: parsedURL.pathname, username: parsedURL.username, password: parsedURL.password, }; diff --git a/test/__snapshots__/validate-options.test.js.snap.webpack4 b/test/__snapshots__/validate-options.test.js.snap.webpack4 index 6a365768ee..c952ed9fa8 100644 --- a/test/__snapshots__/validate-options.test.js.snap.webpack4 +++ b/test/__snapshots__/validate-options.test.js.snap.webpack4 @@ -152,15 +152,15 @@ exports[`options validate should throw an error on the "client" option with '{"w -> Tells clients connected to devServer to use the provided hostname." `; -exports[`options validate should throw an error on the "client" option with '{"webSocketURL":{"hostname":true,"path":"","port":8080}}' value 1`] = ` +exports[`options validate should throw an error on the "client" option with '{"webSocketURL":{"hostname":true,"pathname":"","port":8080}}' value 1`] = ` "ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema. - options.client.webSocketURL.hostname should be a non-empty string. -> Tells clients connected to devServer to use the provided hostname." `; -exports[`options validate should throw an error on the "client" option with '{"webSocketURL":{"path":true}}' value 1`] = ` +exports[`options validate should throw an error on the "client" option with '{"webSocketURL":{"pathname":true}}' value 1`] = ` "ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema. - - options.client.webSocketURL.path should be a string. + - options.client.webSocketURL.pathname should be a string. -> Tells clients connected to devServer to use the provided path to connect." `; @@ -172,7 +172,7 @@ exports[`options validate should throw an error on the "client" option with '{"w exports[`options validate should throw an error on the "client" option with '{"webSocketURL":{"port":true}}' value 1`] = ` "ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema. - options.client.webSocketURL should be one of these: - non-empty string | object { hostname?, path?, password?, port?, protocol?, username? } + non-empty string | object { hostname?, pathname?, password?, port?, protocol?, username? } -> Allows to specify URL to web socket server (useful when you're proxying dev server and client script does not always know where to connect to). Details: * options.client.webSocketURL.port should be one of these: @@ -186,7 +186,7 @@ exports[`options validate should throw an error on the "client" option with '{"w exports[`options validate should throw an error on the "client" option with '{"webSocketURL":{"username":123,"password":976}}' value 1`] = ` "ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema. - options.client.webSocketURL should be one of these: - non-empty string | object { hostname?, path?, password?, port?, protocol?, username? } + non-empty string | object { hostname?, pathname?, password?, port?, protocol?, username? } -> Allows to specify URL to web socket server (useful when you're proxying dev server and client script does not always know where to connect to). Details: * options.client.webSocketURL.password should be a string. diff --git a/test/__snapshots__/validate-options.test.js.snap.webpack5 b/test/__snapshots__/validate-options.test.js.snap.webpack5 index 6a365768ee..c952ed9fa8 100644 --- a/test/__snapshots__/validate-options.test.js.snap.webpack5 +++ b/test/__snapshots__/validate-options.test.js.snap.webpack5 @@ -152,15 +152,15 @@ exports[`options validate should throw an error on the "client" option with '{"w -> Tells clients connected to devServer to use the provided hostname." `; -exports[`options validate should throw an error on the "client" option with '{"webSocketURL":{"hostname":true,"path":"","port":8080}}' value 1`] = ` +exports[`options validate should throw an error on the "client" option with '{"webSocketURL":{"hostname":true,"pathname":"","port":8080}}' value 1`] = ` "ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema. - options.client.webSocketURL.hostname should be a non-empty string. -> Tells clients connected to devServer to use the provided hostname." `; -exports[`options validate should throw an error on the "client" option with '{"webSocketURL":{"path":true}}' value 1`] = ` +exports[`options validate should throw an error on the "client" option with '{"webSocketURL":{"pathname":true}}' value 1`] = ` "ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema. - - options.client.webSocketURL.path should be a string. + - options.client.webSocketURL.pathname should be a string. -> Tells clients connected to devServer to use the provided path to connect." `; @@ -172,7 +172,7 @@ exports[`options validate should throw an error on the "client" option with '{"w exports[`options validate should throw an error on the "client" option with '{"webSocketURL":{"port":true}}' value 1`] = ` "ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema. - options.client.webSocketURL should be one of these: - non-empty string | object { hostname?, path?, password?, port?, protocol?, username? } + non-empty string | object { hostname?, pathname?, password?, port?, protocol?, username? } -> Allows to specify URL to web socket server (useful when you're proxying dev server and client script does not always know where to connect to). Details: * options.client.webSocketURL.port should be one of these: @@ -186,7 +186,7 @@ exports[`options validate should throw an error on the "client" option with '{"w exports[`options validate should throw an error on the "client" option with '{"webSocketURL":{"username":123,"password":976}}' value 1`] = ` "ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema. - options.client.webSocketURL should be one of these: - non-empty string | object { hostname?, path?, password?, port?, protocol?, username? } + non-empty string | object { hostname?, pathname?, password?, port?, protocol?, username? } -> Allows to specify URL to web socket server (useful when you're proxying dev server and client script does not always know where to connect to). Details: * options.client.webSocketURL.password should be a string. diff --git a/test/cli/__snapshots__/basic.test.js.snap.webpack4 b/test/cli/__snapshots__/basic.test.js.snap.webpack4 index f1e641d68d..846a5083da 100644 --- a/test/cli/__snapshots__/basic.test.js.snap.webpack4 +++ b/test/cli/__snapshots__/basic.test.js.snap.webpack4 @@ -59,7 +59,7 @@ Options: --client-web-socket-url Allows to specify URL to web socket server (useful when you're proxying dev server and client script does not always know where to connect to). --client-web-socket-url-hostname Tells clients connected to devServer to use the provided hostname. --client-web-socket-url-port Tells clients connected to devServer to use the provided port. - --client-web-socket-url-path Tells clients connected to devServer to use the provided path to connect. + --client-web-socket-url-pathname Tells clients connected to devServer to use the provided path to connect. --client-web-socket-url-protocol Tells clients connected to devServer to use the provided protocol. --client-web-socket-url-username Tells clients connected to devServer to use the provided username to authenticate. --client-web-socket-url-password Tells clients connected to devServer to use the provided password to authenticate. diff --git a/test/cli/__snapshots__/basic.test.js.snap.webpack5 b/test/cli/__snapshots__/basic.test.js.snap.webpack5 index 3ff62b76c9..38a745c38d 100644 --- a/test/cli/__snapshots__/basic.test.js.snap.webpack5 +++ b/test/cli/__snapshots__/basic.test.js.snap.webpack5 @@ -59,7 +59,7 @@ Options: --client-transport Allows to set custom transport to communicate with dev server. --client-web-socket-url Allows to specify URL to web socket server (useful when you're proxying dev server and client script does not always know where to connect to). --client-web-socket-url-hostname Tells clients connected to devServer to use the provided hostname. - --client-web-socket-url-path Tells clients connected to devServer to use the provided path to connect. + --client-web-socket-url-pathname Tells clients connected to devServer to use the provided path to connect. --client-web-socket-url-password Tells clients connected to devServer to use the provided password to authenticate. --client-web-socket-url-port Tells clients connected to devServer to use the provided port. --client-web-socket-url-protocol Tells clients connected to devServer to use the provided protocol. diff --git a/test/cli/client-option.test.js b/test/cli/client-option.test.js index 152f45de78..0b5222c3e4 100644 --- a/test/cli/client-option.test.js +++ b/test/cli/client-option.test.js @@ -158,8 +158,11 @@ describe('"client" CLI option', () => { expect(exitCode).toEqual(0); }); - it('should work using "--client-web-socket-url-path"', async () => { - const { exitCode } = await testBin(['--client-web-socket-url-path', '/ws']); + it('should work using "--client-web-socket-url-pathname"', async () => { + const { exitCode } = await testBin([ + '--client-web-socket-url-pathname', + '/ws', + ]); expect(exitCode).toEqual(0); }); @@ -180,7 +183,7 @@ describe('"client" CLI option', () => { expect(stdout).toContain('ws%3A%2F%2F0.0.0.0%2Fws'); }); - it('should use "client.webSocketURL.path" from configuration', async () => { + it('should use "client.webSocketURL.pathname" from configuration', async () => { const { exitCode, stdout } = await testBin( null, './test/fixtures/dev-server/client-custom-path-config.js' diff --git a/test/e2e/__snapshots__/web-socket-server-url.test.js.snap.webpack4 b/test/e2e/__snapshots__/web-socket-server-url.test.js.snap.webpack4 index be00b714f7..6ce65f3498 100644 --- a/test/e2e/__snapshots__/web-socket-server-url.test.js.snap.webpack4 +++ b/test/e2e/__snapshots__/web-socket-server-url.test.js.snap.webpack4 @@ -283,7 +283,7 @@ Array [ exports[`web socket server URL should work with the "client.webSocketURL.password" option ("ws"): page errors 1`] = `Array []`; -exports[`web socket server URL should work with the "client.webSocketURL.path" option ("sockjs"): console messages 1`] = ` +exports[`web socket server URL should work with the "client.webSocketURL.pathname" option ("sockjs"): console messages 1`] = ` Array [ "[HMR] Waiting for update signal from WDS...", "Hey.", @@ -292,9 +292,9 @@ Array [ ] `; -exports[`web socket server URL should work with the "client.webSocketURL.path" option ("sockjs"): page errors 1`] = `Array []`; +exports[`web socket server URL should work with the "client.webSocketURL.pathname" option ("sockjs"): page errors 1`] = `Array []`; -exports[`web socket server URL should work with the "client.webSocketURL.path" option ("ws"): console messages 1`] = ` +exports[`web socket server URL should work with the "client.webSocketURL.pathname" option ("ws"): console messages 1`] = ` Array [ "[HMR] Waiting for update signal from WDS...", "Hey.", @@ -303,9 +303,9 @@ Array [ ] `; -exports[`web socket server URL should work with the "client.webSocketURL.path" option ("ws"): page errors 1`] = `Array []`; +exports[`web socket server URL should work with the "client.webSocketURL.pathname" option ("ws"): page errors 1`] = `Array []`; -exports[`web socket server URL should work with the "client.webSocketURL.path" option and custom web socket server "path" ("sockjs"): console messages 1`] = ` +exports[`web socket server URL should work with the "client.webSocketURL.pathname" option and custom web socket server "path" ("sockjs"): console messages 1`] = ` Array [ "[HMR] Waiting for update signal from WDS...", "Hey.", @@ -314,9 +314,9 @@ Array [ ] `; -exports[`web socket server URL should work with the "client.webSocketURL.path" option and custom web socket server "path" ("sockjs"): page errors 1`] = `Array []`; +exports[`web socket server URL should work with the "client.webSocketURL.pathname" option and custom web socket server "path" ("sockjs"): page errors 1`] = `Array []`; -exports[`web socket server URL should work with the "client.webSocketURL.path" option and custom web socket server "path" ("ws"): console messages 1`] = ` +exports[`web socket server URL should work with the "client.webSocketURL.pathname" option and custom web socket server "path" ("ws"): console messages 1`] = ` Array [ "[HMR] Waiting for update signal from WDS...", "Hey.", @@ -325,7 +325,7 @@ Array [ ] `; -exports[`web socket server URL should work with the "client.webSocketURL.path" option and custom web socket server "path" ("ws"): page errors 1`] = `Array []`; +exports[`web socket server URL should work with the "client.webSocketURL.pathname" option and custom web socket server "path" ("ws"): page errors 1`] = `Array []`; exports[`web socket server URL should work with the "client.webSocketURL.port" option ("sockjs"): console messages 1`] = ` Array [ diff --git a/test/e2e/__snapshots__/web-socket-server-url.test.js.snap.webpack5 b/test/e2e/__snapshots__/web-socket-server-url.test.js.snap.webpack5 index be00b714f7..6ce65f3498 100644 --- a/test/e2e/__snapshots__/web-socket-server-url.test.js.snap.webpack5 +++ b/test/e2e/__snapshots__/web-socket-server-url.test.js.snap.webpack5 @@ -283,7 +283,7 @@ Array [ exports[`web socket server URL should work with the "client.webSocketURL.password" option ("ws"): page errors 1`] = `Array []`; -exports[`web socket server URL should work with the "client.webSocketURL.path" option ("sockjs"): console messages 1`] = ` +exports[`web socket server URL should work with the "client.webSocketURL.pathname" option ("sockjs"): console messages 1`] = ` Array [ "[HMR] Waiting for update signal from WDS...", "Hey.", @@ -292,9 +292,9 @@ Array [ ] `; -exports[`web socket server URL should work with the "client.webSocketURL.path" option ("sockjs"): page errors 1`] = `Array []`; +exports[`web socket server URL should work with the "client.webSocketURL.pathname" option ("sockjs"): page errors 1`] = `Array []`; -exports[`web socket server URL should work with the "client.webSocketURL.path" option ("ws"): console messages 1`] = ` +exports[`web socket server URL should work with the "client.webSocketURL.pathname" option ("ws"): console messages 1`] = ` Array [ "[HMR] Waiting for update signal from WDS...", "Hey.", @@ -303,9 +303,9 @@ Array [ ] `; -exports[`web socket server URL should work with the "client.webSocketURL.path" option ("ws"): page errors 1`] = `Array []`; +exports[`web socket server URL should work with the "client.webSocketURL.pathname" option ("ws"): page errors 1`] = `Array []`; -exports[`web socket server URL should work with the "client.webSocketURL.path" option and custom web socket server "path" ("sockjs"): console messages 1`] = ` +exports[`web socket server URL should work with the "client.webSocketURL.pathname" option and custom web socket server "path" ("sockjs"): console messages 1`] = ` Array [ "[HMR] Waiting for update signal from WDS...", "Hey.", @@ -314,9 +314,9 @@ Array [ ] `; -exports[`web socket server URL should work with the "client.webSocketURL.path" option and custom web socket server "path" ("sockjs"): page errors 1`] = `Array []`; +exports[`web socket server URL should work with the "client.webSocketURL.pathname" option and custom web socket server "path" ("sockjs"): page errors 1`] = `Array []`; -exports[`web socket server URL should work with the "client.webSocketURL.path" option and custom web socket server "path" ("ws"): console messages 1`] = ` +exports[`web socket server URL should work with the "client.webSocketURL.pathname" option and custom web socket server "path" ("ws"): console messages 1`] = ` Array [ "[HMR] Waiting for update signal from WDS...", "Hey.", @@ -325,7 +325,7 @@ Array [ ] `; -exports[`web socket server URL should work with the "client.webSocketURL.path" option and custom web socket server "path" ("ws"): page errors 1`] = `Array []`; +exports[`web socket server URL should work with the "client.webSocketURL.pathname" option and custom web socket server "path" ("ws"): page errors 1`] = `Array []`; exports[`web socket server URL should work with the "client.webSocketURL.port" option ("sockjs"): console messages 1`] = ` Array [ diff --git a/test/e2e/web-socket-server-url.test.js b/test/e2e/web-socket-server-url.test.js index 2b3301658f..d5e865d205 100644 --- a/test/e2e/web-socket-server-url.test.js +++ b/test/e2e/web-socket-server-url.test.js @@ -1103,12 +1103,12 @@ describe('web socket server URL', () => { }); }); - it(`should work with the "client.webSocketURL.path" option ("${webSocketServer}")`, async () => { + it(`should work with the "client.webSocketURL.pathname" option ("${webSocketServer}")`, async () => { const compiler = webpack(config); const devServerOptions = { client: { webSocketURL: { - path: '/ws', + pathname: '/ws', }, }, webSocketServer, @@ -1443,12 +1443,12 @@ describe('web socket server URL', () => { }); }); - it(`should work with the "client.webSocketURL.path" option and custom web socket server "path" ("${webSocketServer}")`, async () => { + it(`should work with the "client.webSocketURL.pathname" option and custom web socket server "path" ("${webSocketServer}")`, async () => { const compiler = webpack(config); const devServerOptions = { client: { webSocketURL: { - path: '/custom-ws', + pathname: '/custom-ws', }, }, webSocketServer: { @@ -1696,7 +1696,7 @@ describe('web socket server URL', () => { protocol: 'ws:', hostname: '127.0.0.1', port: port1, - path: '/ws', + pathname: '/ws', }, }, webSocketServer, diff --git a/test/server/utils/__snapshots__/normalizeOptions.test.js.snap.webpack4 b/test/server/utils/__snapshots__/normalizeOptions.test.js.snap.webpack4 index 493d89438b..3e33b7de3e 100644 --- a/test/server/utils/__snapshots__/normalizeOptions.test.js.snap.webpack4 +++ b/test/server/utils/__snapshots__/normalizeOptions.test.js.snap.webpack4 @@ -154,7 +154,7 @@ Object { "hotEntry": true, "overlay": true, "webSocketURL": Object { - "path": "/custom/path/", + "pathname": "/custom/path/", }, }, "compress": true, @@ -191,7 +191,7 @@ Object { "hotEntry": true, "overlay": true, "webSocketURL": Object { - "path": "custom/path", + "pathname": "custom/path", }, }, "compress": true, diff --git a/test/server/utils/__snapshots__/normalizeOptions.test.js.snap.webpack5 b/test/server/utils/__snapshots__/normalizeOptions.test.js.snap.webpack5 index 493d89438b..3e33b7de3e 100644 --- a/test/server/utils/__snapshots__/normalizeOptions.test.js.snap.webpack5 +++ b/test/server/utils/__snapshots__/normalizeOptions.test.js.snap.webpack5 @@ -154,7 +154,7 @@ Object { "hotEntry": true, "overlay": true, "webSocketURL": Object { - "path": "/custom/path/", + "pathname": "/custom/path/", }, }, "compress": true, @@ -191,7 +191,7 @@ Object { "hotEntry": true, "overlay": true, "webSocketURL": Object { - "path": "custom/path", + "pathname": "custom/path", }, }, "compress": true, diff --git a/test/server/utils/normalizeOptions.test.js b/test/server/utils/normalizeOptions.test.js index 550e2535cc..97389ecc74 100644 --- a/test/server/utils/normalizeOptions.test.js +++ b/test/server/utils/normalizeOptions.test.js @@ -146,7 +146,7 @@ describe('normalizeOptions', () => { options: { client: { webSocketURL: { - path: '/custom/path/', + pathname: '/custom/path/', }, }, }, @@ -171,7 +171,7 @@ describe('normalizeOptions', () => { options: { client: { webSocketURL: { - path: 'custom/path', + pathname: 'custom/path', }, }, }, diff --git a/test/validate-options.test.js b/test/validate-options.test.js index 22ca656e55..cdac6396e3 100644 --- a/test/validate-options.test.js +++ b/test/validate-options.test.js @@ -90,13 +90,17 @@ const tests = { webSocketURL: { port: '8080' }, }, { - webSocketURL: { path: '' }, + webSocketURL: { pathname: '' }, }, { - webSocketURL: { path: '/my-path/' }, + webSocketURL: { pathname: '/my-path/' }, }, { - webSocketURL: { hostname: 'localhost', port: 8080, path: '/my-path/' }, + webSocketURL: { + hostname: 'localhost', + port: 8080, + pathname: '/my-path/', + }, }, { webSocketURL: { username: 'zoro', password: 'roronoa' }, @@ -144,10 +148,10 @@ const tests = { transport: true, }, { - webSocketURL: { hostname: true, path: '', port: 8080 }, + webSocketURL: { hostname: true, pathname: '', port: 8080 }, }, { - webSocketURL: { path: true }, + webSocketURL: { pathname: true }, }, { webSocketURL: { port: true },