Socket
Socket
Sign inDemoInstall

http-server

Package Overview
Dependencies
Maintainers
3
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-server - npm Package Compare versions

Comparing version 0.12.0 to 0.12.1

4

lib/http-server.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc