* Stops the HTTP / HTTPS server
()
| 183 | * Stops the HTTP / HTTPS server |
| 184 | */ |
| 185 | public async stop() { |
| 186 | if (!this._listening) return; |
| 187 | debug('Stopping http server'); |
| 188 | if (this._stoppable != null) { |
| 189 | debug('Stopping http server with graceful close'); |
| 190 | this._stoppable.stop(); |
| 191 | } else { |
| 192 | this.server.close(); |
| 193 | } |
| 194 | await once(this.server, 'close'); |
| 195 | this._listening = false; |
| 196 | debug('Http server is stopped'); |
| 197 | } |
| 198 | |
| 199 | /** |
| 200 | * Protocol of the HTTP / HTTPS server |