File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
var path = require ( "path" ) ;
4
4
var url = require ( "url" ) ;
5
+ var fs = require ( "fs" ) ;
5
6
6
7
// Local version replaces global one
7
8
try {
@@ -29,6 +30,12 @@ var optimist = require("optimist")
29
30
30
31
. boolean ( "https" ) . describe ( "https" )
31
32
33
+ . string ( "key" ) . describe ( "key" , "Path to a SSL key." )
34
+
35
+ . string ( "cert" ) . describe ( "cert" , "Path to a SSL certificate." )
36
+
37
+ . string ( "cacert" ) . describe ( "cacert" , "Path to a SSL CA certificate." )
38
+
32
39
. string ( "content-base" ) . describe ( "content-base" , "A directory or URL to serve HTML content from." )
33
40
34
41
. string ( "content-base-target" ) . describe ( "content-base-target" , "Proxy requests to this target." )
@@ -106,6 +113,15 @@ if(argv["quiet"])
106
113
if ( argv [ "https" ] )
107
114
options . https = true ;
108
115
116
+ if ( argv [ "cert" ] )
117
+ options . cert = fs . readFileSync ( path . resolve ( argv [ "cert" ] ) ) ;
118
+
119
+ if ( argv [ "key" ] )
120
+ options . key = fs . readFileSync ( path . resolve ( argv [ "key" ] ) ) ;
121
+
122
+ if ( argv [ "cacert" ] )
123
+ options . cacert = fs . readFileSync ( path . resolve ( argv [ "cacert" ] ) ) ;
124
+
109
125
if ( argv [ "inline" ] )
110
126
options . inline = true ;
111
127
You can’t perform that action at this time.
0 commit comments