Actually add listening http2 servers to server list

This commit is contained in:
murgatroid99 2020-03-05 13:01:43 -08:00
parent 3cbb46b1f7
commit 96d4d6acba
1 changed files with 2 additions and 0 deletions

View File

@ -271,6 +271,7 @@ export class Server {
http2Server.once('error', onError);
http2Server.listen(addr, () => {
this.http2ServerList.push(http2Server);
const boundAddress = http2Server.address()!;
if (typeof boundAddress === 'string') {
resolve(portNum);
@ -311,6 +312,7 @@ export class Server {
http2Server.once('error', onError);
http2Server.listen(address, () => {
this.http2ServerList.push(http2Server);
resolve(bindSpecificPort(addressList.slice(1), (http2Server.address() as AddressInfo).port, 1));
http2Server.removeListener('error', onError);
});