Skip to content

Commit 1cf4359

Browse files
orteth01shellscape
authored andcommitted
add --allowed-hosts CLI option (#1012)
1 parent 72efaab commit 1cf4359

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

bin/webpack-dev-server.js

+8
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,11 @@ yargs.options({
204204
default: "localhost",
205205
describe: "The hostname/ip address the server will bind to",
206206
group: CONNECTION_GROUP
207+
},
208+
"allowed-hosts": {
209+
type: "string",
210+
describe: "A comma-delimited string of hosts that are allowed to access the dev server",
211+
group: CONNECTION_GROUP
207212
}
208213
});
209214

@@ -233,6 +238,9 @@ function processOptions(wpOpt) {
233238
if(argv.host !== "localhost" || !options.host)
234239
options.host = argv.host;
235240

241+
if(argv["allowed-hosts"])
242+
options.allowedHosts = argv["allowed-hosts"].split(",");
243+
236244
if(argv.public)
237245
options.public = argv.public;
238246

0 commit comments

Comments
 (0)