* Stop the HTTP/WS API server and release the lockfile.
()
| 466 | * Stop the HTTP/WS API server and release the lockfile. |
| 467 | */ |
| 468 | async stopServer(): Promise<void> { |
| 469 | try { |
| 470 | await this.mdnsAdvertiser.stop(); |
| 471 | } catch (err) { |
| 472 | log.warn("Failed to stop mDNS advertiser:", err); |
| 473 | } |
| 474 | |
| 475 | if (this.lockfile) { |
| 476 | await this.lockfile.release(); |
| 477 | this.lockfile = null; |
| 478 | } |
| 479 | if (this.server) { |
| 480 | await this.server.close(); |
| 481 | this.server = null; |
| 482 | } |
| 483 | this.serverInfo = null; |
| 484 | } |
| 485 | |
| 486 | /** Return Tailscale-backed local addresses users can bind the remote-access server to. */ |
| 487 | getTailscaleBindHosts(): TailscaleBindHost[] { |