How to password protect a server using Basic Authentication - lwsjs/local-web-server GitHub Wiki
HTTP Basic Authentication is provided by the lws-basic-auth module which is part of the built-in stack.
-
Launch
wssupplying--auth.userand--auth.passvalues. For added security you could also add the--httpsoption.$ ws --auth.user lloyd --auth.pass chimps -
Navigate to the server - you will now be prompted to input a username and password.
To persist options across sessions, add them to the config.
module.exports = {
authUser: 'lloyd',
authPass: 'chimps'
}