Skip to content

Commit 9c3df69

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

File tree

4 files changed

+36
-6
lines changed

4 files changed

+36
-6
lines changed

bin/cli-flags.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,36 @@ module.exports = {
275275
multiple: false,
276276
simpleType: 'string',
277277
},
278+
'client-web-socket-url-username': {
279+
configs: [
280+
{
281+
type: 'string',
282+
multiple: false,
283+
description:
284+
'Tells clients connected to devServer to use the provided username to authenticate.',
285+
path: 'client.webSocketURL.username',
286+
},
287+
],
288+
description:
289+
'Tells clients connected to devServer to use the provided username to authenticate.',
290+
simpleType: 'string',
291+
multiple: false,
292+
},
293+
'client-web-socket-url-password': {
294+
configs: [
295+
{
296+
type: 'string',
297+
multiple: false,
298+
description:
299+
'Tells clients connected to devServer to use the provided password to authenticate.',
300+
path: 'client.webSocketURL.password',
301+
},
302+
],
303+
description:
304+
'Tells clients connected to devServer to use the provided password to authenticate.',
305+
simpleType: 'string',
306+
multiple: false,
307+
},
278308
'web-socket-server': {
279309
configs: [
280310
{

lib/options.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,11 @@
154154
"type": "string"
155155
},
156156
"username": {
157-
"description": "Tells clients connected to devServer to use the provided username to connect.",
157+
"description": "Tells clients connected to devServer to use the provided username to authenticate.",
158158
"type": "string"
159159
},
160160
"password": {
161-
"description": "Tells clients connected to devServer to use the provided password to connect.",
161+
"description": "Tells clients connected to devServer to use the provided password to authenticate.",
162162
"type": "string"
163163
},
164164
"port": {

test/server/__snapshots__/Server.test.js.snap.webpack5

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ exports[`Server DevServerPlugin add hot option 1`] = `
44
Array [
55
Array [
66
"client",
7-
"index.js?ws%3A%2F%2Flocalhost%3A8103%2Fws",
7+
"index.js?ws%3A%2F%2Flocalhost%3A8104%2Fws",
88
],
99
Array [
1010
"node_modules",
@@ -22,7 +22,7 @@ exports[`Server DevServerPlugin add hot-only option 1`] = `
2222
Array [
2323
Array [
2424
"client",
25-
"index.js?ws%3A%2F%2Flocalhost%3A8103%2Fws",
25+
"index.js?ws%3A%2F%2Flocalhost%3A8104%2Fws",
2626
],
2727
Array [
2828
"node_modules",
@@ -40,7 +40,7 @@ exports[`Server DevServerPlugin should create and run server with old parameters
4040
Array [
4141
Array [
4242
"client",
43-
"index.js?ws%3A%2F%2Flocalhost%3A8103%2Fws",
43+
"index.js?ws%3A%2F%2Flocalhost%3A8104%2Fws",
4444
],
4545
Array [
4646
"node_modules",

test/server/servers/__snapshots__/WebsocketServer.test.js.snap.webpack5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`WebsocketServer should receive connection, send message, and close client 1`] = `"localhost:8129"`;
3+
exports[`WebsocketServer should receive connection, send message, and close client 1`] = `"localhost:8130"`;
44

55
exports[`WebsocketServer should receive connection, send message, and close client 2`] = `
66
Array [

0 commit comments

Comments
 (0)