未验证 提交 11eaf0b4 编写于 作者: A Asher

Fix being unable to use [::] for the host

Fixes #1582.
上级 8b5deac9
......@@ -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)
}
})
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册