Skip to content

Commit 7acccf8

Browse files
committed
Add debug for the endpoint event from SSE server
1 parent 3f19483 commit 7acccf8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/claude_gateway.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ function connectSSEBackend() {
3939
const timer = setTimeout(() => reject(new Error("SSE Backend Connection timeout")), 10_000);
4040
const source = new EventSource(backendUrlSse);
4141
source.onopen = (evt: Event) => resolve(clearTimeout(timer));
42-
source.addEventListener("endpoint", (e) => (backendUrlMsg = `${baseUrl}${e.data}`));
42+
source.addEventListener("endpoint", (e) => {
43+
backendUrlMsg = `${baseUrl}${e.data}`;
44+
debug(`--- SSE backend sent "endpoint" event (${e.data}) ==> Setting message endpoint URL: "${backendUrlMsg}"`);
45+
});
4346
source.addEventListener("error", (e) => reject(e));
4447
source.addEventListener("message", (e) => respond(e.data)); // forward to Claude Desktop App via stdio transport
4548
source.addEventListener("message", (e) => debug(`<-- ${e.data}`));

0 commit comments

Comments
 (0)