tlsd 2.2.0 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -6
- package/package.json +1 -1
- package/tlsd +7 -1
- package/tlsd.js +9 -0
package/README.md
CHANGED
|
@@ -1,17 +1,56 @@
|
|
|
1
1
|
|
|
2
2
|
# tlsd
|
|
3
3
|
|
|
4
|
-
## Install
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
There are 2 ways to use this:
|
|
7
6
|
|
|
7
|
+
1. Install globally as CLI command "tlsd"
|
|
8
|
+
2. Install locally to an existing project directory and executed with "npx tlsd"
|
|
8
9
|
|
|
9
|
-
### Dev Mode
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
stuff:
|
|
11
|
+
## Install Globally
|
|
13
12
|
|
|
14
|
-
|
|
13
|
+
npm install -g tlsd
|
|
14
|
+
|
|
15
|
+
You should how have a CLI command "tlsd"
|
|
16
|
+
|
|
17
|
+
tlsd
|
|
18
|
+
|
|
19
|
+
This way lets you run a project without having to have tlsd included in it.
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## Install Locally
|
|
23
|
+
|
|
24
|
+
npm install --save tlsd
|
|
25
|
+
|
|
26
|
+
The tlsd module should now be added to your local package.json file and you can
|
|
27
|
+
run it this way:
|
|
28
|
+
|
|
29
|
+
npx tlsd
|
|
30
|
+
|
|
31
|
+
This way you can just use it to serve your local project in dev or production mode.
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## tlsd init
|
|
35
|
+
|
|
36
|
+
Creates empty scaffolding files for a project:
|
|
37
|
+
|
|
38
|
+
tlsd init my_project
|
|
39
|
+
|
|
40
|
+
This can then be tested by starting the server:
|
|
41
|
+
|
|
42
|
+
tlsd run dev my_project 12345 3
|
|
43
|
+
|
|
44
|
+
And then browsing to "http://localhost:12345".
|
|
45
|
+
You should see the pages being delivered and a websocket connecting being established.
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
## tlsd run dev
|
|
49
|
+
|
|
50
|
+
In dev mode, tlsd runs a plain HTTP server without TLS/SSL security.
|
|
51
|
+
This is for local (your computer) development:
|
|
52
|
+
|
|
53
|
+
tlsd root_dir port_num log_level
|
|
15
54
|
|
|
16
55
|
All arguments are required
|
|
17
56
|
|
|
@@ -30,5 +69,7 @@ You must also add your domain to greenlock before running nodes or it won't be r
|
|
|
30
69
|
|
|
31
70
|
npx greenlock add --subject example.com --altnames example.com,www.example.com
|
|
32
71
|
|
|
72
|
+
Production mode serves files with Letsencrypt SSL certs magically.
|
|
73
|
+
|
|
33
74
|
|
|
34
75
|
|
package/package.json
CHANGED
package/tlsd
CHANGED
package/tlsd.js
CHANGED
|
@@ -361,6 +361,15 @@ if( argv.length == 5 ) {
|
|
|
361
361
|
usage();
|
|
362
362
|
}
|
|
363
363
|
|
|
364
|
+
}
|
|
365
|
+
else
|
|
366
|
+
if( argv.length == 3 && argv[ 2 ] == "-v" ) {
|
|
367
|
+
|
|
368
|
+
// pull package version from package.json and print it
|
|
369
|
+
|
|
370
|
+
const p = require( __dirname + "/package.json" );
|
|
371
|
+
log( p.version );
|
|
372
|
+
|
|
364
373
|
}
|
|
365
374
|
else {
|
|
366
375
|
usage();
|