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.
This commit is contained in:
Sarah Fortune authored and GitHub committed 2025-07-16 11:28:07 -07:00
1 parent 4c3384988c
commit 8a2e90084d
2 files changed
+6 -2

No files matched your search

+4 -1
View File
@@ -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}`)
+2 -1
View File
@@ -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)