From ba9d52697d22a586f8092ff886b4616ff50ea295 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Nov 2026 19:13:43 +0000 Subject: [PATCH 1/2] fix(servers): report the bound port, free it on force stop, one Stop-all summary - The launcher reports the port the server actually listens on (getListeningPort), so the HTTPS port in the list and URL matches. - forceStop closes the listener and its connections instead of only dropping the reference, so the port is released. - Port search follows the requested port (+100) instead of stopping at 8080; the host-less probe checks the wildcard and loopback. - A server that cannot be registered is stopped and the launch fails. - Stop all: counts running servers and shows a single summary. Part of the XR environment review epic (S4). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_014FkKtAtQus8TVjhG9bhytC --- apps/vscode-extension/CHANGELOG.md | 7 ++ .../src/core/server/httpServer.ts | 16 +++- .../src/core/server/httpsServerBase.ts | 29 +++++- .../src/core/server/multiServerLauncher.ts | 90 +++++++++++++++---- .../src/core/server/portManager.ts | 41 ++++++++- .../src/core/server/serverControl.ts | 53 +++++------ .../src/core/server/serverFactory.ts | 4 +- .../views/handleServerActions.ts | 30 ++++--- .../multiServerLauncher.transcripts.json | 54 +++++------ .../serverActionHandlers.transcripts.json | 10 +-- .../test/servers/multiServerLauncher.test.cjs | 10 ++- .../servers/serverActionHandlers.test.cjs | 15 ++-- .../test/servers/serverLifecycle.test.cjs | 36 +++++++- 13 files changed, 279 insertions(+), 116 deletions(-) diff --git a/apps/vscode-extension/CHANGELOG.md b/apps/vscode-extension/CHANGELOG.md index 7418cb28..d24b99fc 100644 --- a/apps/vscode-extension/CHANGELOG.md +++ b/apps/vscode-extension/CHANGELOG.md @@ -37,6 +37,13 @@ - **Historical comparison and project evolution no longer refuse a folder opened through a link.** When the analyzed folder was reached through a symbolic link, a junction, or a shortened Windows path (`C:\Users\JOHNDO~1\...`), Code-XR compared it with the repository path Git reports and wrongly concluded the folder was outside the repository, so the Git-based analyses were unavailable. Both paths are now resolved to their real location before they are compared. - **The installed extension only ever runs the Python analysis scripts it ships with.** If its bundled copy of an analysis script was missing (a damaged or partially deleted install), Code-XR fell back to a developer location two folders above the extension, which in an installed copy is your home folder, and could have run a file found there. That fallback is now limited to development builds; an installed extension reports the missing script instead. - **The analysis backend loads again on Python 3.8 and 3.9.** One type annotation in the line-metrics module used syntax that only exists from Python 3.10, so on 3.8 or 3.9 every analysis failed as soon as the backend loaded, although the extension asks only for Python 3.7 or newer. The annotation now uses the older spelling; results on newer Python versions are unchanged. +- **Local servers are reported on the port they actually listen on, and stopping them frees the port.** Several issues in how XR scenes are served are fixed: + - When the requested port was taken, an HTTPS server could pick a different port from the one shown in the Active Servers list and the opened URL. The launcher now reports the port the server really bound. + - "Force stop" removed a server from the list without closing it, so the port stayed busy until VS Code restarted. It now closes the listener and its open connections. + - When the requested port is busy, the next 100 ports are tried. Before, the search stopped at 8080, so a busy port of 8080 or higher made every launch fail. + - A port held on `localhost` only is no longer reported free (on macOS and Windows the browser could reach the other program instead of the scene). + - A server that started but could not be added to the list is shut down, and the launch is reported as failed instead of leaving an unreachable server running. + - "Stop all servers" counts only running servers in its prompt and shows one summary instead of one notification per server, saying how many did not shut down cleanly. - A source file of the XR chart-mapping runtime contained a raw control character typed into a string. Behaviour was correct, but the file was invisible to code search and review tools. It now uses the equivalent escape sequence; the runtime value is identical. ## [1.2.0] - 2026-07-30 diff --git a/apps/vscode-extension/src/core/server/httpServer.ts b/apps/vscode-extension/src/core/server/httpServer.ts index cbd16dcf..1d7f2c18 100644 --- a/apps/vscode-extension/src/core/server/httpServer.ts +++ b/apps/vscode-extension/src/core/server/httpServer.ts @@ -229,8 +229,22 @@ export class HttpServer { */ public forceStop(): void { this.disposeRuntimeFeatures(); - this.server?.closeAllConnections(); + const server = this.server; + this.server = null; this.isRunning = false; + if (server) { + // close() stops accepting connections and releases the port; it + // was never called here, so a force-stopped server kept listening + // with no entry left in the tree to stop it from. + server.close(() => undefined); + server.closeAllConnections(); + } + } + + /** The port the listener is actually bound to, or null when not listening. */ + public getListeningPort(): number | null { + const address = this.server?.address(); + return address && typeof address === 'object' ? address.port : null; } /** diff --git a/apps/vscode-extension/src/core/server/httpsServerBase.ts b/apps/vscode-extension/src/core/server/httpsServerBase.ts index 46054eac..59da4291 100644 --- a/apps/vscode-extension/src/core/server/httpsServerBase.ts +++ b/apps/vscode-extension/src/core/server/httpsServerBase.ts @@ -106,8 +106,22 @@ export abstract class HttpsServerBase { */ public forceStop(): void { this.httpHandler.disposeRuntimeFeatures(); - this.server?.closeAllConnections(); + const server = this.server; + this.server = null; this.isRunning = false; + if (server) { + // close() stops accepting connections and releases the port; it + // was never called here, so a force-stopped server kept listening + // with no entry left in the tree to stop it from. + server.close(() => undefined); + server.closeAllConnections(); + } + } + + /** The port the listener is actually bound to, or null when not listening. */ + public getListeningPort(): number | null { + const address = this.server?.address(); + return address && typeof address === 'object' ? address.port : null; } public getIsRunning(): boolean { @@ -157,8 +171,19 @@ export abstract class HttpsServerBase { } } - /** Finds a free port from the configured one upwards and adopts it. */ + /** + * Keeps the configured port when it is free, and only otherwise searches + * upwards and adopts the next free one. The launcher has already picked a + * free port; searching again unconditionally went through get-port, which + * locks every port it returns for 15-30 s and therefore skipped the very + * port the launcher had just chosen, so the server listened one port above + * the one shown in the tree, the toast and the LAN URL. + */ protected async resolveListeningPort(): Promise { + if (await PortManager.isPortAvailable(this.config.port, this.config.host)) { + logger.debug(() => `Port ${this.config.port} is available on host ${this.config.host}`); + return; + } logger.debug(() => `Looking for available port starting from ${this.config.port} on host ${this.config.host}...`); const availablePort = await PortManager.findAvailablePort(this.config.port, this.config.port + 100, this.config.host); diff --git a/apps/vscode-extension/src/core/server/multiServerLauncher.ts b/apps/vscode-extension/src/core/server/multiServerLauncher.ts index b339f322..338266c4 100644 --- a/apps/vscode-extension/src/core/server/multiServerLauncher.ts +++ b/apps/vscode-extension/src/core/server/multiServerLauncher.ts @@ -71,6 +71,47 @@ export class MultiServerLauncher { logger.debug('Multi-server launcher initialized'); } + /** Logs (and, when it differs, announces) the port a server bound; returns whether it changed. */ + private reportBoundPort(requestedPort: number, boundPort: number): boolean { + if (boundPort === requestedPort) { + logger.debug(() => `Using requested port ${boundPort}`); + return false; + } + logger.debug(() => `Port ${requestedPort} already in use. Using port ${boundPort} instead.`); + notifyPortChanged(requestedPort, boundPort); + return true; + } + + /** Opens a freshly launched server per the settings; a failure is logged, never thrown. */ + private async openLaunchedServer( + settings: Parameters[0], + serverUrl: string, + htmlFile: string | undefined, + activeServerId: string + ): Promise { + try { + await handleAutoOpening(settings, serverUrl, htmlFile, determineLaunchMode(settings), activeServerId); + } catch (error) { + logger.error('Failed to open the launched server:', error); + } + } + + /** Stops a server that started but could not be registered, falling back to forceStop. */ + private async discardUnregisteredServer(instance: { stop?: () => Promise; forceStop?: () => void } | undefined): Promise { + try { + if (typeof instance?.stop === 'function') { + await instance.stop(); + } + } catch (stopError) { + logger.warn('Stopping the unregistered server failed; forcing it closed:', stopError); + try { + instance?.forceStop?.(); + } catch (forceError) { + logger.warn('Forcing the unregistered server closed failed:', forceError); + } + } + } + /** * Launch a new server instance with dynamic port allocation * @param htmlFile Optional HTML file to serve @@ -114,14 +155,6 @@ export class MultiServerLauncher { // Find available port using dynamic allocation const requestedPort = settings.defaultPort; const finalPort = await this.findAvailablePortWithLogging(requestedPort); - const portChanged = finalPort !== requestedPort; - - if (portChanged) { - logger.debug(() => `Port ${requestedPort} already in use. Using port ${finalPort} instead.`); - notifyPortChanged(requestedPort, finalPort); - } else { - logger.debug(() => `Using requested port ${finalPort}`); - } // Launch the server - Use 0.0.0.0 to listen on all network interfaces for external access const host = '0.0.0.0'; @@ -137,7 +170,12 @@ export class MultiServerLauncher { ); if (result.success && result.serverUrl) { - logger.debug(() => `Successfully launched ${serverType} server on port ${finalPort}`); + // The port the server really listens on. Everything below + // (registry, session, toasts, LAN URL) uses it, never the port + // that was only requested. + const boundPort = result.port ?? finalPort; + const portChanged = this.reportBoundPort(requestedPort, boundPort); + logger.debug(() => `Successfully launched ${serverType} server on port ${boundPort}`); // Generate unique server ID const serverId = this.generateServerId(); @@ -147,7 +185,7 @@ export class MultiServerLauncher { id: serverId, server: result.serverInstance!, serverType: serverType, - port: finalPort, + port: boundPort, htmlFile: htmlFile, activeServerId: '' }; @@ -159,12 +197,12 @@ export class MultiServerLauncher { logger.debug('DEBUG - About to register server with the following details:'); logger.debug('DEBUG - customName:', customName); - logger.debug('DEBUG - port:', finalPort); + logger.debug('DEBUG - port:', boundPort); logger.debug('DEBUG - url:', result.serverUrl); const registrar = getServerRegistrar(); const activeServer = registrar.registerServer({ - port: finalPort, + port: boundPort, url: result.serverUrl, launchMode: launchMode, certMode: certMode, @@ -192,22 +230,31 @@ export class MultiServerLauncher { logger.debug(() => `Successfully registered server ${serverId} (active ID: ${activeServer.id}) via registrar service`); logger.debug(() => `Currently managing ${this.servers.size} server(s)`); - - // Handle auto-opening based on configuration - await handleAutoOpening(settings, result.serverUrl, htmlFile, launchMode, serverInfo.activeServerId); - } catch (error) { + // A server nobody registered cannot be found, listed or + // stopped again: stop it now and report the launch as failed + // instead of leaving an unreachable listener on 0.0.0.0. logger.error('Failed to register server in registry:', error); - // Don't fail the launch if registry registration fails + this.servers.delete(serverId); + await this.discardUnregisteredServer(result.serverInstance); + return { + success: false, + error: `Failed to register the server: ${error instanceof Error ? error.message : String(error)}`, + httpsOverridden: isHttpsOverridden + }; } + // Handle auto-opening based on configuration. A failure to open + // the page does not undo a server that is running and listed. + await this.openLaunchedServer(settings, result.serverUrl, htmlFile, serverInfo.activeServerId); + return { success: true, serverUrl: result.serverUrl, serverType: serverType, serverId: serverId, activeServerId: serverInfo.activeServerId || undefined, - port: finalPort, + port: boundPort, httpsOverridden: isHttpsOverridden, portChanged: portChanged, originalPort: requestedPort @@ -253,7 +300,12 @@ export class MultiServerLauncher { logger.debug(() => `Port ${requestedPort} already in use. Searching for next available port (${requestedPort + 1})...`); try { - const availablePort = await PortManager.findAvailablePort(requestedPort + 1); + // The search window follows the requested port: the default end port + // (8080) made a busy 8080 (allowed by the settings) fail every launch. + const availablePort = await PortManager.findAvailablePort( + requestedPort + 1, + Math.min(65535, requestedPort + 100), + ); logger.debug(() => `Free port found at ${availablePort}. Launching server...`); return availablePort; } catch (error) { diff --git a/apps/vscode-extension/src/core/server/portManager.ts b/apps/vscode-extension/src/core/server/portManager.ts index 59bd533c..2a948c1f 100644 --- a/apps/vscode-extension/src/core/server/portManager.ts +++ b/apps/vscode-extension/src/core/server/portManager.ts @@ -15,10 +15,14 @@ export class PortManager { /** * Check if a specific port is available * @param port - The port number to check - * @param host - The host to bind to (default: '0.0.0.0') + * @param host - The host to bind to. Without one, the port must be free on + * the wildcard address and on loopback (see isPortFreeEverywhere). * @returns Promise - True if port is available, false otherwise */ - public static async isPortAvailable(port: number, host: string = '0.0.0.0'): Promise { + public static async isPortAvailable(port: number, host?: string): Promise { + if (host === undefined) { + return PortManager.isPortFreeEverywhere(port); + } return new Promise((resolve) => { const server = net.createServer(); @@ -41,6 +45,36 @@ export class PortManager { }); } + /** + * True only when the port is free on the wildcard address AND on loopback + * (IPv4 and IPv6). Checking 0.0.0.0 alone is not enough on macOS and + * Windows: a wildcard bind can succeed while another process (a Vite or + * Next dev server, typically on 3000) owns 127.0.0.1 or ::1, and + * "localhost" then reaches that other app instead of Code-XR. + */ + public static async isPortFreeEverywhere(port: number): Promise { + for (const host of ['0.0.0.0', '127.0.0.1', '::1']) { + const free = await PortManager.isPortAvailableOnHost(port, host); + if (!free) { + return false; + } + } + return true; + } + + /** Like isPortAvailable, but a host this machine does not have (no IPv6) counts as free. */ + private static isPortAvailableOnHost(port: number, host: string): Promise { + return new Promise((resolve) => { + const server = net.createServer(); + server.once('error', (err: NodeJS.ErrnoException) => { + resolve(err.code === 'EADDRNOTAVAIL' || err.code === 'EAFNOSUPPORT'); + }); + server.listen({ port, host, exclusive: true }, () => { + server.close(() => resolve(true)); + }); + }); + } + /** * Find the first available port starting from a given port number * @param startPort - The starting port number (default: 3000) @@ -81,9 +115,10 @@ export class PortManager { logger.debug(() => `Checking ${ports.length} ports sequentially from ${startPort} to ${startPort + maxRange - 1}`); + // No host: get-port then checks the wildcard and every local + // interface, loopback included (see isPortFreeEverywhere). const availablePort = await getPort({ port: ports, - host: '0.0.0.0' // Use 0.0.0.0 to check availability on all interfaces }); logger.debug(() => `Found available port: ${availablePort} (sequential search successful)`); diff --git a/apps/vscode-extension/src/core/server/serverControl.ts b/apps/vscode-extension/src/core/server/serverControl.ts index 52e5271b..00adb786 100644 --- a/apps/vscode-extension/src/core/server/serverControl.ts +++ b/apps/vscode-extension/src/core/server/serverControl.ts @@ -18,6 +18,12 @@ const STOP_TIMEOUT_MS = 4000; * Server Control * Runtime operations for managing active servers */ +/** What a bulk stop did: how many running servers it tried, and how many stopped cleanly. */ +export interface StopAllServersResult { + requested: number; + stopped: number; +} + export class ServerControl { private static extensionContext: vscode.ExtensionContext; @@ -31,7 +37,7 @@ export class ServerControl { /** * Stop an active server */ - public static async stopServer(serverId: string): Promise { + public static async stopServer(serverId: string, options: { silent?: boolean } = {}): Promise { logger.debug(() => `DEBUG - Attempting to stop server ${serverId}`); const registry = getActiveServerRegistry(); @@ -97,7 +103,7 @@ export class ServerControl { } logger.debug(() => `Stopped server ${serverId} (${server.url}), clean: ${cleanShutdown}`); - if (cleanShutdown) { + if (cleanShutdown && !options.silent) { void vscode.window.showInformationMessage(`Server stopped: ${server.url}`); } @@ -155,24 +161,26 @@ export class ServerControl { } /** - * Stop all active servers + * Stop every running server. Shows no message of its own: the caller + * reports one summary from the returned counts. (It used to return a bare + * count that its caller read as a yes/no, and both layers toasted, so a + * partial failure showed "Stopped 2/3" followed by "Stopped all 3".) */ - public static async stopAllServers(): Promise { + public static async stopAllServers(): Promise { logger.debug('Stopping all active servers'); - + const registry = getActiveServerRegistry(); const runningServers = registry.getServersByStatus('running'); - + if (runningServers.length === 0) { logger.debug('No running servers to stop'); - void vscode.window.showInformationMessage('No active servers to stop'); - return 0; + return { requested: 0, stopped: 0 }; } // First, close all lateral panels for servers that have them const panelManager = getPanelManager(); const lateralPanelServers = runningServers.filter(server => server.launchMode === 'lateralPanel'); - + if (lateralPanelServers.length > 0) { logger.debug(() => `ACTIVE_SERVER_PANEL: Closing ${lateralPanelServers.length} lateral panels before stopping servers`); const serverIdsWithPanels = lateralPanelServers.map(server => server.id); @@ -180,28 +188,13 @@ export class ServerControl { logger.debug(() => `ACTIVE_SERVER_PANEL: Closed ${closedPanelCount}/${lateralPanelServers.length} lateral panels`); } - let stoppedCount = 0; - const stopPromises = runningServers.map(async (server) => { - const success = await this.stopServer(server.id); - if (success) { - stoppedCount++; - } - return success; - }); - - await Promise.all(stopPromises); - - logger.debug(() => `Stopped ${stoppedCount}/${runningServers.length} servers`); - - if (stoppedCount === runningServers.length) { - void vscode.window.showInformationMessage(`All ${stoppedCount} servers stopped successfully`); - } else { - void vscode.window.showWarningMessage( - `Stopped ${stoppedCount}/${runningServers.length} servers. Some servers may require manual intervention.` - ); - } + const results = await Promise.all( + runningServers.map(server => this.stopServer(server.id, { silent: true })), + ); + const stopped = results.filter(Boolean).length; - return stoppedCount; + logger.debug(() => `Stopped ${stopped}/${runningServers.length} servers`); + return { requested: runningServers.length, stopped }; } /** diff --git a/apps/vscode-extension/src/core/server/serverFactory.ts b/apps/vscode-extension/src/core/server/serverFactory.ts index 8253014a..53b1980f 100644 --- a/apps/vscode-extension/src/core/server/serverFactory.ts +++ b/apps/vscode-extension/src/core/server/serverFactory.ts @@ -203,7 +203,9 @@ export async function launchServerByType( success: true, serverUrl, serverType, - port, + // Report the port the listener is bound to, which is what every + // URL, tree entry and session must use. + port: server.getListeningPort?.() ?? port, serverInstance: server }; diff --git a/apps/vscode-extension/src/features/active-servers/views/handleServerActions.ts b/apps/vscode-extension/src/features/active-servers/views/handleServerActions.ts index 216d5d52..6beefbfc 100644 --- a/apps/vscode-extension/src/features/active-servers/views/handleServerActions.ts +++ b/apps/vscode-extension/src/features/active-servers/views/handleServerActions.ts @@ -420,17 +420,19 @@ export class ServerActionHandlers { */ public static async stopAllServers(): Promise { logger.debug('Stopping all servers'); - + + // Count what "Stop all" will actually stop: the running servers. The + // prompt used to count every entry, whatever its status. const registry = getActiveServerRegistry(); - const allServers = registry.getAllServers(); - - if (allServers.length === 0) { + const runningCount = registry.getServersByStatus('running').length; + + if (runningCount === 0) { void vscode.window.showInformationMessage('No servers are currently running'); return; } const response = await vscode.window.showWarningMessage( - `Stop all ${allServers.length} server(s)?`, + `Stop all ${runningCount} server(s)?`, 'Stop All', 'Cancel' ); @@ -438,17 +440,19 @@ export class ServerActionHandlers { if (response === 'Stop All') { try { await RemoteAccessManager.getInstance()?.stopAll(); - logger.debug(() => `Stopping ${allServers.length} servers`); - const success = await ServerControl.stopAllServers(); - - if (success) { + logger.debug(() => `Stopping ${runningCount} servers`); + const { requested, stopped } = await ServerControl.stopAllServers(); + + if (stopped === requested) { logger.debug('Successfully stopped all servers'); - void vscode.window.showInformationMessage(`Stopped all ${allServers.length} servers`); + void vscode.window.showInformationMessage(`Stopped ${stopped} server(s)`); } else { - logger.error('Failed to stop some servers'); - void vscode.window.showWarningMessage('Some servers may not have stopped properly'); + logger.error(`Stopped ${stopped} of ${requested} servers`); + void vscode.window.showWarningMessage( + `Stopped ${stopped} of ${requested} server(s). The others were removed from the list but did not shut down cleanly; see the CodeXR output.` + ); } - + // Refresh the tree view void vscode.commands.executeCommand('codeXR.activeServers.refreshServers'); } catch (error) { diff --git a/apps/vscode-extension/test/servers/fixtures/multiServerLauncher.transcripts.json b/apps/vscode-extension/test/servers/fixtures/multiServerLauncher.transcripts.json index ad80daf3..42dbbb9f 100644 --- a/apps/vscode-extension/test/servers/fixtures/multiServerLauncher.transcripts.json +++ b/apps/vscode-extension/test/servers/fixtures/multiServerLauncher.transcripts.json @@ -8,12 +8,12 @@ "log: SERVER: Determined server type: [\"http\"]", "log: SERVER: Checking availability of port 3000...", "log: SERVER: Port 3000 is available", - "log: SERVER: Using requested port 3000", "log: SERVER: DEBUG - Configuring server to listen on 0.0.0.0:3000 for network access", "log: SERVER: Using static root: /scene", "log: SERVER: Main file configured: index.html", "log: SERVER: Creating HTTP server...", "log: SERVER: Starting http server...", + "log: SERVER: Using requested port 3000", "log: SERVER: Successfully launched http server on port 3000", "log: SERVER: DEBUG - About to register server with the following details:", "log: SERVER: DEBUG - customName: [\"My scene\"]", @@ -104,11 +104,11 @@ "log: SERVER: Determined server type: [\"http\"]", "log: SERVER: Checking availability of port 3000...", "log: SERVER: Port 3000 is available", - "log: SERVER: Using requested port 3000", "log: SERVER: DEBUG - Configuring server to listen on 0.0.0.0:3000 for network access", "log: SERVER: Using static root: /templates", "log: SERVER: Creating HTTP server...", "log: SERVER: Starting http server...", + "log: SERVER: Using requested port 3000", "log: SERVER: Successfully launched http server on port 3000", "log: SERVER: DEBUG - About to register server with the following details:", "log: SERVER: DEBUG - customName: [\"\"]", @@ -198,12 +198,12 @@ "log: SERVER: Determined server type: [\"http\"]", "log: SERVER: Checking availability of port 3000...", "log: SERVER: Port 3000 is available", - "log: SERVER: Using requested port 3000", "log: SERVER: DEBUG - Configuring server to listen on 0.0.0.0:3000 for network access", "log: SERVER: Using static root: /scene", "log: SERVER: Main file configured: index.html", "log: SERVER: Creating HTTP server...", "log: SERVER: Starting http server...", + "log: SERVER: Using requested port 3000", "log: SERVER: Successfully launched http server on port 3000", "log: SERVER: DEBUG - About to register server with the following details:", "log: SERVER: DEBUG - customName: [\"\"]", @@ -296,12 +296,12 @@ "log: SERVER: Checking availability of port 3000...", "log: SERVER: Port 3000 already in use. Searching for next available port (3001)...", "log: SERVER: Free port found at 3001. Launching server...", - "log: SERVER: Port 3000 already in use. Using port 3001 instead.", "log: SERVER: DEBUG - Configuring server to listen on 0.0.0.0:3001 for network access", "log: SERVER: Using static root: /scene", "log: SERVER: Main file configured: index.html", "log: SERVER: Creating HTTPS server with generated local certificates...", "log: SERVER: Starting https-default server...", + "log: SERVER: Port 3000 already in use. Using port 3001 instead.", "log: SERVER: Successfully launched https-default server on port 3001", "log: SERVER: DEBUG - About to register server with the following details:", "log: SERVER: DEBUG - customName: [\"Secure\"]", @@ -353,7 +353,8 @@ ], [ "findAvailablePort", - 3001 + 3001, + 3100 ] ], "previews": [ @@ -401,12 +402,12 @@ "log: SERVER: Determined server type: [\"https-custom\"]", "log: SERVER: Checking availability of port 3000...", "log: SERVER: Port 3000 is available", - "log: SERVER: Using requested port 3000", "log: SERVER: DEBUG - Configuring server to listen on 0.0.0.0:3000 for network access", "log: SERVER: Using static root: /scene", "log: SERVER: Main file configured: index.html", "log: SERVER: Creating HTTPS server with custom certificates...", "log: SERVER: Starting https-custom server...", + "log: SERVER: Using requested port 3000", "log: SERVER: Successfully launched https-custom server on port 3000", "log: SERVER: DEBUG - About to register server with the following details:", "log: SERVER: DEBUG - customName: [\"\"]", @@ -498,7 +499,6 @@ "log: SERVER: Determined server type: [\"https-custom\"]", "log: SERVER: Checking availability of port 3000...", "log: SERVER: Port 3000 is available", - "log: SERVER: Using requested port 3000", "log: SERVER: DEBUG - Configuring server to listen on 0.0.0.0:3000 for network access", "log: SERVER: Using static root: /scene", "log: SERVER: Main file configured: index.html", @@ -539,12 +539,12 @@ "log: SERVER: *** IMPORTANT *** Temporarily overriding HTTPS to HTTP for lateral panel compatibility", "log: SERVER: Checking availability of port 3000...", "log: SERVER: Port 3000 is available", - "log: SERVER: Using requested port 3000", "log: SERVER: DEBUG - Configuring server to listen on 0.0.0.0:3000 for network access", "log: SERVER: Using static root: /scene", "log: SERVER: Main file configured: index.html", "log: SERVER: Creating HTTP server...", "log: SERVER: Starting http server...", + "log: SERVER: Using requested port 3000", "log: SERVER: Successfully launched http server on port 3000", "log: SERVER: DEBUG - About to register server with the following details:", "log: SERVER: DEBUG - customName: [\"\"]", @@ -652,12 +652,12 @@ "log: SERVER: *** IMPORTANT *** Temporarily overriding HTTPS to HTTP for lateral panel compatibility", "log: SERVER: Checking availability of port 3000...", "log: SERVER: Port 3000 is available", - "log: SERVER: Using requested port 3000", "log: SERVER: DEBUG - Configuring server to listen on 0.0.0.0:3000 for network access", "log: SERVER: Using static root: /scene", "log: SERVER: Main file configured: index.html", "log: SERVER: Creating HTTP server...", "log: SERVER: Starting http server...", + "log: SERVER: Using requested port 3000", "log: SERVER: Successfully launched http server on port 3000", "log: SERVER: DEBUG - About to register server with the following details:", "log: SERVER: DEBUG - customName: [\"\"]", @@ -756,12 +756,12 @@ "log: SERVER: Determined server type: [\"http\"]", "log: SERVER: Checking availability of port 3000...", "log: SERVER: Port 3000 is available", - "log: SERVER: Using requested port 3000", "log: SERVER: DEBUG - Configuring server to listen on 0.0.0.0:3000 for network access", "log: SERVER: Using static root: /scene", "log: SERVER: Main file configured: index.html", "log: SERVER: Creating HTTP server...", "log: SERVER: Starting http server...", + "log: SERVER: Using requested port 3000", "log: SERVER: Successfully launched http server on port 3000", "log: SERVER: DEBUG - About to register server with the following details:", "log: SERVER: DEBUG - customName: [\"\"]", @@ -851,12 +851,12 @@ "log: SERVER: Determined server type: [\"http\"]", "log: SERVER: Checking availability of port 3000...", "log: SERVER: Port 3000 is available", - "log: SERVER: Using requested port 3000", "log: SERVER: DEBUG - Configuring server to listen on 0.0.0.0:3000 for network access", "log: SERVER: Using static root: /scene", "log: SERVER: Main file configured: index.html", "log: SERVER: Creating HTTP server...", "log: SERVER: Starting http server...", + "log: SERVER: Using requested port 3000", "log: SERVER: Successfully launched http server on port 3000", "log: SERVER: DEBUG - About to register server with the following details:", "log: SERVER: DEBUG - customName: [\"\"]", @@ -955,12 +955,12 @@ "log: SERVER: Determined server type: [\"http\"]", "log: SERVER: Checking availability of port 3000...", "log: SERVER: Port 3000 is available", - "log: SERVER: Using requested port 3000", "log: SERVER: DEBUG - Configuring server to listen on 0.0.0.0:3000 for network access", "log: SERVER: Using static root: /scene", "log: SERVER: Main file configured: index.html", "log: SERVER: Creating HTTP server...", "log: SERVER: Starting http server...", + "log: SERVER: Using requested port 3000", "log: SERVER: Successfully launched http server on port 3000", "log: SERVER: DEBUG - About to register server with the following details:", "log: SERVER: DEBUG - customName: [\"\"]", @@ -1061,12 +1061,12 @@ "log: SERVER: Determined server type: [\"https-default\"]", "log: SERVER: Checking availability of port 3000...", "log: SERVER: Port 3000 is available", - "log: SERVER: Using requested port 3000", "log: SERVER: DEBUG - Configuring server to listen on 0.0.0.0:3000 for network access", "log: SERVER: Using static root: /scene", "log: SERVER: Main file configured: index.html", "log: SERVER: Creating HTTPS server with generated local certificates...", "log: SERVER: Starting https-default server...", + "log: SERVER: Using requested port 3000", "log: SERVER: Successfully launched https-default server on port 3000", "log: SERVER: DEBUG - About to register server with the following details:", "log: SERVER: DEBUG - customName: [\"\"]", @@ -1150,12 +1150,12 @@ "log: SERVER: Determined server type: [\"http\"]", "log: SERVER: Checking availability of port 3000...", "log: SERVER: Port 3000 is available", - "log: SERVER: Using requested port 3000", "log: SERVER: DEBUG - Configuring server to listen on 0.0.0.0:3000 for network access", "log: SERVER: Using static root: /scene", "log: SERVER: Main file configured: index.html", "log: SERVER: Creating HTTP server...", "log: SERVER: Starting http server...", + "log: SERVER: Using requested port 3000", "log: SERVER: Successfully launched http server on port 3000", "log: SERVER: DEBUG - About to register server with the following details:", "log: SERVER: DEBUG - customName: [\"\"]", @@ -1256,12 +1256,12 @@ "log: SERVER: Determined server type: [\"http\"]", "log: SERVER: Checking availability of port 3000...", "log: SERVER: Port 3000 is available", - "log: SERVER: Using requested port 3000", "log: SERVER: DEBUG - Configuring server to listen on 0.0.0.0:3000 for network access", "log: SERVER: Using static root: /scene", "log: SERVER: Main file configured: index.html", "log: SERVER: Creating HTTP server...", "log: SERVER: Starting http server...", + "log: SERVER: Using requested port 3000", "log: SERVER: Successfully launched http server on port 3000", "log: SERVER: DEBUG - About to register server with the following details:", "log: SERVER: DEBUG - customName: [\"\"]", @@ -1351,7 +1351,6 @@ "log: SERVER: Determined server type: [\"http\"]", "log: SERVER: Checking availability of port 3000...", "log: SERVER: Port 3000 is available", - "log: SERVER: Using requested port 3000", "log: SERVER: DEBUG - Configuring server to listen on 0.0.0.0:3000 for network access", "log: SERVER: Using static root: /scene", "log: SERVER: Main file configured: index.html", @@ -1419,7 +1418,8 @@ ], [ "findAvailablePort", - 3001 + 3001, + 3100 ] ], "previews": [], @@ -1434,7 +1434,7 @@ "executedCommands": [], "clipboard": "" }, - "registration fails: the launch still succeeds, the launcher keeps nothing": { + "registration fails: the server is stopped and the launch fails": { "console": [ "log: SERVER: Multi-server launcher initialized", "log: SERVER: Starting multi-server launch process...", @@ -1443,12 +1443,12 @@ "log: SERVER: Determined server type: [\"http\"]", "log: SERVER: Checking availability of port 3000...", "log: SERVER: Port 3000 is available", - "log: SERVER: Using requested port 3000", "log: SERVER: DEBUG - Configuring server to listen on 0.0.0.0:3000 for network access", "log: SERVER: Using static root: /scene", "log: SERVER: Main file configured: index.html", "log: SERVER: Creating HTTP server...", "log: SERVER: Starting http server...", + "log: SERVER: Using requested port 3000", "log: SERVER: Successfully launched http server on port 3000", "log: SERVER: DEBUG - About to register server with the following details:", "log: SERVER: DEBUG - customName: [\"\"]", @@ -1486,15 +1486,9 @@ "previews": [], "results": [ { - "success": true, - "serverUrl": "http://localhost:3000", - "serverType": "http", - "serverId": "server_