@@ -100,12 +100,11 @@ module.exports = function createServers(options, listening) {
100
100
}
101
101
102
102
var server = http . createServer ( options . http . handler || handler ) ,
103
+ timeout = options . timeout || options . http . timeout ,
103
104
port = ! isNaN ( options . http . port ) ? + options . http . port : 80 , // accepts string or number
104
105
args ;
105
106
106
- if ( typeof options . http . timeout === 'number' ) {
107
- server . setTimeout ( options . http . timeout ) ;
108
- }
107
+ if ( typeof timeout === 'number' ) server . setTimeout ( timeout ) ;
109
108
110
109
args = [ server , port ] ;
111
110
if ( options . http . host ) {
@@ -130,6 +129,7 @@ module.exports = function createServers(options, listening) {
130
129
var ssl = options . https ,
131
130
port = ! isNaN ( ssl . port ) ? + ssl . port : 443 , // accepts string or number
132
131
ciphers = ssl . ciphers || CIPHERS ,
132
+ timeout = options . timeout || ssl . timeout ,
133
133
ca = ssl . ca ,
134
134
server ,
135
135
args ;
@@ -169,7 +169,7 @@ module.exports = function createServers(options, listening) {
169
169
log ( 'https | listening on %d' , port ) ;
170
170
server = https . createServer ( finalHttpsOptions , ssl . handler || handler ) ;
171
171
172
- if ( typeof ssl . timeout === 'number' ) server . setTimeout ( ssl . timeout ) ;
172
+ if ( typeof timeout === 'number' ) server . setTimeout ( timeout ) ;
173
173
args = [ server , port ] ;
174
174
if ( options . https . host ) {
175
175
args . push ( options . https . host ) ;
0 commit comments