How It Works


www

By typing www will start a web server on port 8000 by default and use as document root the directory where the command was call

$ www

A different document root may be specified by using the -r option, for example:

$ www -r /tmp

By default www listen on port 8000, this can be changed by using the -p option:

$ www -p 80

may need root privileges

If TLS is required use the option -s and a domain name, for example:

$ www -s example.com

This will try to get a valid certificate by using letsencrypt but the port will always be 443

In case need to create a self-signed certificate and use a different port, use the localhost as the domain:

$ www -s localhost -r /tmp -p 8080

when using the -s use https option on the browser

Type www -h for see all options:

Usage of ./www:
  -p port
        Listen on port (default 8000)
  -q quiet
        quiet mode
  -r root
        Document root path (default ".")
  -s your-domain.tld
        https://your-domain.tld if "localhost", port can be other than 443

Example:

example