Skip to content

Commit 078cd17

Browse files
committed
feat: allow username and password in clientURL
1 parent 6699595 commit 078cd17

File tree

3 files changed

+45
-1
lines changed

3 files changed

+45
-1
lines changed

test/e2e/__snapshots__/web-socket-server-url.test.js.snap.webpack4

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,3 +436,25 @@ Array [
436436
`;
437437

438438
exports[`web socket server URL should work with the "client.webSocketURL.protocol" option using "http:" value and covert to "ws:" ("ws"): page errors 1`] = `Array []`;
439+
440+
exports[`web socket server URL should work with the "client.webSocketURL.username" and "client.webSocketURL.password" option ("sockjs"): console messages 1`] = `
441+
Array [
442+
"[HMR] Waiting for update signal from WDS...",
443+
"Hey.",
444+
"[webpack-dev-server] Hot Module Replacement enabled.",
445+
"[webpack-dev-server] Live Reloading enabled.",
446+
]
447+
`;
448+
449+
exports[`web socket server URL should work with the "client.webSocketURL.username" and "client.webSocketURL.password" option ("sockjs"): page errors 1`] = `Array []`;
450+
451+
exports[`web socket server URL should work with the "client.webSocketURL.username" and "client.webSocketURL.password" option ("ws"): console messages 1`] = `
452+
Array [
453+
"[HMR] Waiting for update signal from WDS...",
454+
"Hey.",
455+
"[webpack-dev-server] Hot Module Replacement enabled.",
456+
"[webpack-dev-server] Live Reloading enabled.",
457+
]
458+
`;
459+
460+
exports[`web socket server URL should work with the "client.webSocketURL.username" and "client.webSocketURL.password" option ("ws"): page errors 1`] = `Array []`;

test/e2e/__snapshots__/web-socket-server-url.test.js.snap.webpack5

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,3 +436,25 @@ Array [
436436
`;
437437

438438
exports[`web socket server URL should work with the "client.webSocketURL.protocol" option using "http:" value and covert to "ws:" ("ws"): page errors 1`] = `Array []`;
439+
440+
exports[`web socket server URL should work with the "client.webSocketURL.username" and "client.webSocketURL.password" option ("sockjs"): console messages 1`] = `
441+
Array [
442+
"[HMR] Waiting for update signal from WDS...",
443+
"Hey.",
444+
"[webpack-dev-server] Hot Module Replacement enabled.",
445+
"[webpack-dev-server] Live Reloading enabled.",
446+
]
447+
`;
448+
449+
exports[`web socket server URL should work with the "client.webSocketURL.username" and "client.webSocketURL.password" option ("sockjs"): page errors 1`] = `Array []`;
450+
451+
exports[`web socket server URL should work with the "client.webSocketURL.username" and "client.webSocketURL.password" option ("ws"): console messages 1`] = `
452+
Array [
453+
"[HMR] Waiting for update signal from WDS...",
454+
"Hey.",
455+
"[webpack-dev-server] Hot Module Replacement enabled.",
456+
"[webpack-dev-server] Live Reloading enabled.",
457+
]
458+
`;
459+
460+
exports[`web socket server URL should work with the "client.webSocketURL.username" and "client.webSocketURL.password" option ("ws"): page errors 1`] = `Array []`;

test/e2e/web-socket-server-url.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,7 @@ describe('web socket server URL', () => {
12521252
const webSocketRequest = webSocketRequests[0];
12531253

12541254
expect(webSocketRequest.url).toContain(
1255-
`${websocketURLProtocol}://127.0.0.1:${port5}/ws`
1255+
`${websocketURLProtocol}://zenitsu:chuntaro@127.0.0.1:${port5}/ws`
12561256
);
12571257
expect(consoleMessages.map((message) => message.text())).toMatchSnapshot(
12581258
'console messages'

0 commit comments

Comments
 (0)