From 8a2e90084d4389e9a2be8d6d0048a84f91dba330 Mon Sep 17 00:00:00 2001 From: Sarah Fortune Date: Wed, 16 Jul 2025 11:28:07 -0700 Subject: [PATCH] Change the port numbers for the ProtoBus service and HostBridge. (#4969) Don't use the default gRPC port number because it's more likely to already be in use. --- src/standalone/cline-core.ts | 5 ++++- src/standalone/host-bridge-client-manager.ts | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/standalone/cline-core.ts b/src/standalone/cline-core.ts index 8548b69e..64391159 100644 --- a/src/standalone/cline-core.ts +++ b/src/standalone/cline-core.ts @@ -15,6 +15,9 @@ import { WebviewProviderType } from "@/shared/webview/types" import { v4 as uuidv4 } from "uuid" import { ExternalDiffViewProvider } from "./ExternalDiffviewProvider" +export const PROTOBUS_PORT = 26040 +export const HOSTBRIDGE_PORT = 26041 + async function main() { log("Starting standalone service...") @@ -42,7 +45,7 @@ function startProtobusService(controller: Controller) { reflection.addToServer(server) // Start the server. - const host = process.env.PROTOBUS_ADDRESS || "127.0.0.1:50051" + const host = process.env.PROTOBUS_ADDRESS || `127.0.0.1:${PROTOBUS_PORT}` server.bindAsync(host, grpc.ServerCredentials.createInsecure(), (err) => { if (err) { log(`Error: Failed to bind to ${host}, port may be unavailable. ${err.message}`) diff --git a/src/standalone/host-bridge-client-manager.ts b/src/standalone/host-bridge-client-manager.ts index 39e753d0..cab2296a 100644 --- a/src/standalone/host-bridge-client-manager.ts +++ b/src/standalone/host-bridge-client-manager.ts @@ -14,6 +14,7 @@ import { DiffServiceClientInterface, } from "@generated/hosts/host-bridge-client-types" import { HostBridgeClientProvider } from "@/hosts/host-provider-types" +import { HOSTBRIDGE_PORT } from "./cline-core" /** * Manager to hold the gRPC clients for the host bridge. The clients should be re-used to avoid @@ -28,7 +29,7 @@ export class ExternalHostBridgeClientManager implements HostBridgeClientProvider diffClient: DiffServiceClientInterface constructor() { - const address = process.env.HOST_BRIDGE_ADDRESS || "localhost:50052" + const address = process.env.HOST_BRIDGE_ADDRESS || `localhost:${HOSTBRIDGE_PORT}` this.channel = createChannel(address) this.watchServiceClient = new WatchServiceClientImpl(this.channel)