From 11eaf0b470c922693851c8a613e2cc2eb2fa6503 Mon Sep 17 00:00:00 2001 From: Asher Date: Wed, 30 Sep 2020 12:02:31 -0500 Subject: [PATCH] Fix being unable to use [::] for the host Fixes #1582. --- src/node/http.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/node/http.ts b/src/node/http.ts index a8abb94b..297dda0c 100644 --- a/src/node/http.ts +++ b/src/node/http.ts @@ -584,8 +584,11 @@ export class HttpServer { const onListen = (): void => resolve(this.address()) if (this.options.socket) { this.server.listen(this.options.socket, onListen) + } else if (this.options.host) { + // [] is the correct format when using :: but Node errors with them. + this.server.listen(this.options.port, this.options.host.replace(/^\[|\]$/g, ""), onListen) } else { - this.server.listen(this.options.port, this.options.host, onListen) + this.server.listen(this.options.port, onListen) } }) }