File tree 2 files changed +32
-0
lines changed
2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 6
6
**
7
7
*/
8
8
9
+ var fs = require ( 'fs' ) ;
10
+
9
11
var config = {
10
12
add_proxy_header : true , //activate addition of X-Forwarded-For header for better logging on real server side
11
13
allow_ip_list : './config/allow_ip_list' ,
12
14
black_list : './config/black_list' ,
13
15
host_filters : './config/hostfilters.js' ,
14
16
listen :[ { ip :'0.0.0.0' , port :80 } , //all ipv4 interfaces
15
17
{ ip :'::' , port :80 } ] //all ipv6 interfaces
18
+ listen_ssl :[ {
19
+ ip :'0.0.0.0' , //all *secure* ipv4 interfaces
20
+ port :443 ,
21
+ key :fs . readFileSync ( '/path/to/ssl.key' ) ,
22
+ cert :fs . readFileSync ( '/path/to/ssl.crt' ) ,
23
+ ca :[ fs . readFileSync ( '/path/to/ca.pem' ) ,
24
+ fs . readFileSync ( '/path/to/sub-ca.pem' ) ]
25
+ } , {
26
+ ip :'::' , //all *secure* ipv6 interfaces
27
+ port :443 ,
28
+ key :fs . readFileSync ( '/path/to/ssl.key' ) ,
29
+ cert :fs . readFileSync ( '/path/to/ssl.crt' ) ,
30
+ ca :[ fs . readFileSync ( '/path/to/ca.pem' ) ,
31
+ fs . readFileSync ( '/path/to/sub-ca.pem' ) ]
32
+
33
+ }
34
+ ]
16
35
} ;
17
36
18
37
exports . config = config ;
Original file line number Diff line number Diff line change 7
7
*/
8
8
9
9
var http = require ( 'http' ) ,
10
+ https = require ( 'https' ) ;
10
11
util = require ( 'util' ) ;
11
12
fs = require ( 'fs' ) ,
12
13
config = require ( './config' ) . config ,
@@ -356,8 +357,20 @@ update_blacklist();
356
357
update_iplist ( ) ;
357
358
update_hostfilters ( ) ;
358
359
360
+ //http
359
361
config . listen . forEach ( function ( listen ) {
360
362
util . log ( "Starting reverse proxy server on port '" + listen . ip + ':' + listen . port ) ;
361
363
http . createServer ( server_cb ) . listen ( listen . port , listen . ip ) ;
362
364
} ) ;
363
365
366
+ //httpS
367
+ config . listen_ssl . forEach ( function ( listen ) {
368
+ util . log ( "Starting *secure* reverse proxy server on port '" + listen . ip + ':' + listen . port ) ;
369
+ var options = {
370
+ cert : listen . cert ,
371
+ key : listen . key ,
372
+ ca : listen . ca
373
+ }
374
+ https . createServer ( options , server_cb ) . listen ( listen . port , listen . ip ) ;
375
+ } ) ;
376
+
You can’t perform that action at this time.
0 commit comments