* fix(desktop): restore direct LAN connections Desktop 0.3.0 routed remote WebSockets through the Electron main process, causing previously working macOS LAN connections to fail with EHOSTUNREACH. Revert custom direct headers and restore the renderer WebSocket path used before the regression. * fix(app): replace host connections by identity Keep one connection per stable ID when TLS or password settings change. This preserves the current-main upsert invariant while the custom-header rollback removes the unrelated transport feature.
32 lines
1.0 KiB
TypeScript
32 lines
1.0 KiB
TypeScript
import {
|
|
closeLocalTransportSession,
|
|
listenToLocalTransportEvents,
|
|
openLocalTransportSession,
|
|
sendLocalTransportMessage,
|
|
type LocalTransportTarget,
|
|
} from "./desktop-daemon";
|
|
|
|
export interface LocalDaemonTransportEvent {
|
|
sessionId: string;
|
|
kind: "open" | "message" | "close" | "error";
|
|
text?: string | null;
|
|
binaryBase64?: string | null;
|
|
code?: number | null;
|
|
reason?: string | null;
|
|
error?: string | null;
|
|
}
|
|
|
|
export interface LocalDaemonTransportRpc {
|
|
openSession(target: LocalTransportTarget): Promise<string>;
|
|
listenToEvents(handler: (event: LocalDaemonTransportEvent) => void): Promise<() => void>;
|
|
sendMessage(input: { sessionId: string; text?: string; binaryBase64?: string }): Promise<void>;
|
|
closeSession(sessionId: string): Promise<void>;
|
|
}
|
|
|
|
export const defaultLocalDaemonTransportRpc: LocalDaemonTransportRpc = {
|
|
openSession: openLocalTransportSession,
|
|
listenToEvents: listenToLocalTransportEvents,
|
|
sendMessage: sendLocalTransportMessage,
|
|
closeSession: closeLocalTransportSession,
|
|
};
|