Skip to content

How to password protect a server using Basic Authentication

Lloyd Brookes edited this page Jul 13, 2017 · 2 revisions

HTTP Basic Authentication is provided by the lws-basic-auth module which is part of the built-in stack.

  1. Launch ws supplying --auth.user and --auth.pass values. For added security you could also add the --https option.

    $ ws --auth.user lloyd --auth.pass chimps
    
  2. 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'
}
Clone this wiki locally