Skip to content

Commit 29ff12f

Browse files
committed
[fix] add ability to configure timeout
1 parent 838b14b commit 29ff12f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ module.exports = function createServers(options, listening) {
103103
port = !isNaN(options.http.port) ? +options.http.port : 80, // accepts string or number
104104
args;
105105

106+
if (typeof options.http.timeout === 'number') {
107+
server.setTimeout(options.http.timeout);
108+
}
109+
106110
args = [server, port];
107111
if (options.http.host) {
108112
args.push(options.http.host);
@@ -165,6 +169,7 @@ module.exports = function createServers(options, listening) {
165169
log('https | listening on %d', port);
166170
server = https.createServer(finalHttpsOptions, ssl.handler || handler);
167171

172+
if (typeof ssl.timeout === 'number') server.setTimeout(ssl.timeout);
168173
args = [server, port];
169174
if (options.https.host) {
170175
args.push(options.https.host);

0 commit comments

Comments
 (0)