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.
Files changed (4) hide show
  1. package/README.md +47 -6
  2. package/package.json +1 -1
  3. package/tlsd +7 -1
  4. 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
- npm install tlsd
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
- In dev mode it runs a plain HTTP server without any of the certificate
12
- stuff:
11
+ ## Install Globally
13
12
 
14
- node tlsd.js root_dir port_num log_level
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tlsd",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
4
4
  "description": "An server for web app prototyping with HTTPS and Websockets",
5
5
  "main": "tlsd.js",
6
6
  "bin": {
package/tlsd CHANGED
@@ -96,6 +96,12 @@ if [ "$cmd" = "init" ] ; then
96
96
  fi
97
97
 
98
98
 
99
- echo "Usage: tlsd init|run ..."
99
+ if [ "$cmd" = "version" ] || [ "$cmd" = "-v" ] ; then
100
+ node "$home/tlsd.js" -v
101
+ exit 0;
102
+ fi
103
+
104
+
105
+ echo "Usage: tlsd init|run|version ..."
100
106
  exit 1
101
107
 
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();