Skip to content

Commit 10f934a

Browse files
committed
Improve documentation. Update dependencies.
1 parent 1ad80b5 commit 10f934a

File tree

4 files changed

+137
-74
lines changed

4 files changed

+137
-74
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,22 @@ It works with MacOS, Linux and Windows, on Chrome and Firefox, and requires you
1313
[![GitHub issues](https://img.shields.io/github/issues/daquinoaldo/https-localhost.svg)](https://github.com/daquinoaldo/https-localhost/issues)
1414

1515

16+
## Dependencies
17+
nss/certutils are needed for Firefox and Chrome.
18+
#### MacOS
19+
```
20+
brew install nss
21+
```
22+
#### Linux
23+
```
24+
sudo apt install libnss3-tools
25+
-or-
26+
sudo yum install nss-tools
27+
-or-
28+
sudo pacman -S nss
29+
```
30+
31+
1632
## Install and use standalone
1733
```
1834
npm i -g --only=prod https-localhost

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ const createServer = () => {
4040
/* istanbul ignore next: cannot be tested on Travis */ httpPort = 80,
4141
httpsPort = process.env.PORT || 443) {
4242
app.http = http.createServer((req, res) => {
43-
const reqHost = req.headers["host"]
44-
? req.headers["host"].replace(":" + httpPort, "")
43+
const reqHost = req.headers.host
44+
? req.headers.host.replace(":" + httpPort, "")
4545
: /* istanbul ignore next: cannot be tested */ "localhost"
4646
res.writeHead(301, {
4747
Location: "https://" + reqHost +

package-lock.json

Lines changed: 116 additions & 69 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)