You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,11 +38,11 @@ sudo pacman -S nss
38
38
npm i -g --only=prod https-localhost
39
39
```
40
40
```bash
41
-
serve~/myproj
41
+
https-localhost~/myproj
42
42
```
43
43
-`sudo` may be necessary.
44
44
- If a static path is not provided the current directory content will be served.
45
-
- You can change the **port** setting the `PORT` environmental variable: `PORT=4433 serve ~/myproj`. Specifying port number will also prevent http to https redirect.
45
+
- You can change the **port** setting the `PORT` environmental variable: `PORT=4433 https-localhost ~/myproj`. Specifying port number will also prevent http to https redirect.
46
46
47
47
### Binaries
48
48
If you don't have Node.js installed just use a packaged version! Download it from the [release page](https://github.com/daquinoaldo/https-localhost/releases).
@@ -91,7 +91,7 @@ const server = https.createServer(certs, app).listen(port)
91
91
## Production
92
92
This tool has a production version that activates **HTTP/2**, **compression** and **minify**.
93
93
```bash
94
-
NODE_ENV=production serve~/myproj
94
+
NODE_ENV=production https-localhost~/myproj
95
95
```
96
96
I decide to not activate it by default since it is usually an unwanted behaviour for localhost testing, but sometimes it could be userful, e.g. to test Progressive Web Application or more ingeneral the website performances.
97
97
@@ -129,14 +129,14 @@ https-localhost is compatible with the LTS and latest version of Node.js.
129
129
<sub>If you need compatibility with other Node.js versions let me know, we'll try to rearrange the code.</sub>
130
130
131
131
### root required
132
-
-**At first run** this tool generate a trusted certificate. The sudo password may be required. If you cannot provide the sudo password generate a `localhost.key` and `localhost.crt` and specify its path with `CERT_PATH=/diractory/containing/certificates/ serve ~/myproj`.
132
+
-**At first run** this tool generate a trusted certificate. The sudo password may be required. If you cannot provide the sudo password generate a `localhost.key` and `localhost.crt` and specify its path with `CERT_PATH=/diractory/containing/certificates/ https-localhost ~/myproj`.
133
133
-**At each run** the password may be required to run the server on port 443 and 80. To avoid the script ask for password specify a different port number: `PORT=4433 serve ~/myproj`.
134
134
135
135
### EACCES
136
-
Run with sudo to use the default ports 443 and 80. You can also change port with: `PORT=4433 serve ~/myproj`.
136
+
Run with sudo to use the default ports 443 and 80. You can also change port with: `PORT=4433 https-localhost ~/myproj`.
137
137
138
138
### EADDRINUSE
139
-
Another service on your machine is using port 443 or port 80. Stop it or change port with `PORT=4433 serve ~/myproj`.
139
+
Another service on your machine is using port 443 or port 80. Stop it or change port with `PORT=4433 https-localhost ~/myproj`.
140
140
141
141
### Unable to run on Windows
142
142
Windows users with spaces or quotes in the name (like Aldo D'Aquino) may experience some problems in running the script. You can try to escape this chars or put the entire path between double quotes, but I suggest you to switch to a better user name (like aldodaquino).
@@ -154,7 +154,7 @@ I've tried to reproduce this error without any success (checkout the [Travis bui
154
154
### ERR_SSL_PROTOCOL_ERROR
155
155
And in general all the cases when the script runs but the connection is marked as untrusted.
156
156
157
-
Force a reinstall of the certificate with `REINSTALL=true serve`. `sudo` may be required on linux and MacOS.
157
+
Force a reinstall of the certificate with `REINSTALL=true https-localhost`. `sudo` may be required on linux and MacOS.
158
158
159
159
If the problem is solved you should be able to use https-localhost also as module.
0 commit comments