Allow configuring the listen host (#9924)
This commit is contained in:
parent
f68e13d905
commit
3dfe3aa9a4
5 changed files with 15 additions and 9 deletions
|
@ -176,10 +176,10 @@ export class ServerService {
|
|||
fastify.server.on('error', err => {
|
||||
switch ((err as any).code) {
|
||||
case 'EACCES':
|
||||
this.logger.error(`You do not have permission to listen on port ${this.config.port}.`);
|
||||
this.logger.error(`You do not have permission to listen on port ${this.config.port}${this.config.host ? ` of host ${this.config.host}` : ''}`);
|
||||
break;
|
||||
case 'EADDRINUSE':
|
||||
this.logger.error(`Port ${this.config.port} is already in use by another process.`);
|
||||
this.logger.error(`Port ${this.config.port}${this.config.host ? ` on ${this.config.host}` : ''} is already in use by another process.`);
|
||||
break;
|
||||
default:
|
||||
this.logger.error(err);
|
||||
|
@ -194,6 +194,6 @@ export class ServerService {
|
|||
}
|
||||
});
|
||||
|
||||
fastify.listen({ port: this.config.port, host: '0.0.0.0' });
|
||||
fastify.listen({ port: this.config.port, host: this.config.host });
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue