mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 21:28:26 +00:00
refactor: remove bridge protocol
This commit is contained in:
@@ -22,7 +22,7 @@ export function attachGatewayWsConnectionHandler(params: {
|
||||
wss: WebSocketServer;
|
||||
clients: Set<GatewayWsClient>;
|
||||
port: number;
|
||||
bridgeHost?: string;
|
||||
gatewayHost?: string;
|
||||
canvasHostEnabled: boolean;
|
||||
canvasHostServerPort?: number;
|
||||
resolvedAuth: ResolvedGatewayAuth;
|
||||
@@ -46,7 +46,7 @@ export function attachGatewayWsConnectionHandler(params: {
|
||||
wss,
|
||||
clients,
|
||||
port,
|
||||
bridgeHost,
|
||||
gatewayHost,
|
||||
canvasHostEnabled,
|
||||
canvasHostServerPort,
|
||||
resolvedAuth,
|
||||
@@ -76,7 +76,7 @@ export function attachGatewayWsConnectionHandler(params: {
|
||||
|
||||
const canvasHostPortForWs = canvasHostServerPort ?? (canvasHostEnabled ? port : undefined);
|
||||
const canvasHostOverride =
|
||||
bridgeHost && bridgeHost !== "0.0.0.0" && bridgeHost !== "::" ? bridgeHost : undefined;
|
||||
gatewayHost && gatewayHost !== "0.0.0.0" && gatewayHost !== "::" ? gatewayHost : undefined;
|
||||
const canvasHostUrl = resolveCanvasHostUrl({
|
||||
canvasPort: canvasHostPortForWs,
|
||||
hostOverride: canvasHostServerPort ? canvasHostOverride : undefined,
|
||||
@@ -182,6 +182,13 @@ export function attachGatewayWsConnectionHandler(params: {
|
||||
},
|
||||
);
|
||||
}
|
||||
if (client?.connect?.role === "node") {
|
||||
const context = buildRequestContext();
|
||||
const nodeId = context.nodeRegistry.unregister(connId);
|
||||
if (nodeId) {
|
||||
context.nodeUnsubscribeAll(nodeId);
|
||||
}
|
||||
}
|
||||
logWs("out", "close", {
|
||||
connId,
|
||||
code,
|
||||
|
||||
Reference in New Issue
Block a user