http-server
Advanced tools
Comparing version 0.12.0 to 0.12.1
@@ -85,4 +85,2 @@ 'use strict'; | ||
this.brotli = options.brotli === true; | ||
this.contentType = options.contentType || 'application/octet-stream'; | ||
if (options.ext) { | ||
@@ -93,2 +91,4 @@ this.ext = options.ext === true | ||
} | ||
this.contentType = options.contentType || | ||
this.ext === 'html' ? 'text/html' : 'application/octet-stream'; | ||
@@ -95,0 +95,0 @@ var before = options.before ? options.before.slice() : []; |
{ | ||
"name": "http-server", | ||
"version": "0.12.0", | ||
"version": "0.12.1", | ||
"description": "A simple zero-configuration command-line http server", | ||
@@ -5,0 +5,0 @@ "main": "./lib/http-server", |
@@ -82,2 +82,4 @@ [![build status](https://img.shields.io/travis/http-party/http-server.svg?style=flat-square)](https://travis-ci.org/http-party/http-server) | ||
`-v` or `--version` Print the version and exit. | ||
## Magic Files | ||
@@ -98,10 +100,31 @@ | ||
## Need a self signed SSL Certificate? | ||
## TLS/SSL | ||
Create the `cert.pem` and `key.pem` via the command: | ||
First, you need to make sure that [openssl](https://github.com/openssl/openssl) is installed correctly, and you have `key.pem` and `cert.pem` files. You can generate them using this command: | ||
``` | ||
``` sh | ||
openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem | ||
``` | ||
You will be prompted with a few questions after entering the command. Use `127.0.0.1` as value for `Common name` if you want to be able to install the certificate in your OS's root certificate store or browser so that it is trusted. | ||
This generates a cert-key pair and it will be valid for 3650 days (about 10 years). | ||
Then you need to run the server with `-S` for enabling SSL and `-C` for your certificate file. | ||
``` sh | ||
http-server -S -C cert.pem | ||
``` | ||
This is what should be output if successful: | ||
``` sh | ||
Starting up http-server, serving ./ through https | ||
Available on: | ||
https:127.0.0.1:8080 | ||
https:192.168.1.101:8080 | ||
https:192.168.1.104:8080 | ||
Hit CTRL-C to stop the server | ||
``` | ||
# Development | ||
@@ -108,0 +131,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
20998
182
140
1