@graphty/remote-logger 1.2.2 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -2
- package/dist/bundle/browser-entry.d.ts +34 -0
- package/dist/bundle/browser-entry.d.ts.map +1 -0
- package/dist/bundle/browser-entry.js +129 -0
- package/dist/bundle/browser-entry.js.map +1 -0
- package/dist/client/RemoteLogClient.d.ts +2 -1
- package/dist/client/RemoteLogClient.d.ts.map +1 -1
- package/dist/client/RemoteLogClient.js +20 -10
- package/dist/client/RemoteLogClient.js.map +1 -1
- package/dist/client/types.d.ts +6 -0
- package/dist/client/types.d.ts.map +1 -1
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +20 -1
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/mcp-server.d.ts +5 -0
- package/dist/mcp/mcp-server.d.ts.map +1 -1
- package/dist/mcp/mcp-server.js +54 -8
- package/dist/mcp/mcp-server.js.map +1 -1
- package/dist/mcp/tools/index.d.ts +6 -6
- package/dist/mcp/tools/index.d.ts.map +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/index.js.map +1 -1
- package/dist/mcp/tools/logs-clear.d.ts +1 -2
- package/dist/mcp/tools/logs-clear.d.ts.map +1 -1
- package/dist/mcp/tools/logs-get-all.d.ts +1 -2
- package/dist/mcp/tools/logs-get-all.d.ts.map +1 -1
- package/dist/mcp/tools/logs-get-errors.d.ts +1 -2
- package/dist/mcp/tools/logs-get-errors.d.ts.map +1 -1
- package/dist/mcp/tools/logs-get-file-path.d.ts +8 -2
- package/dist/mcp/tools/logs-get-file-path.d.ts.map +1 -1
- package/dist/mcp/tools/logs-get-file-path.js +1 -1
- package/dist/mcp/tools/logs-get-file-path.js.map +1 -1
- package/dist/mcp/tools/logs-receive.d.ts +9 -10
- package/dist/mcp/tools/logs-receive.d.ts.map +1 -1
- package/dist/mcp/tools/logs-search.d.ts +1 -2
- package/dist/mcp/tools/logs-search.d.ts.map +1 -1
- package/dist/mcp/tools/logs-status.d.ts.map +1 -1
- package/dist/mcp/tools/logs-status.js +4 -1
- package/dist/mcp/tools/logs-status.js.map +1 -1
- package/dist/remote-logger.browser.js +166 -0
- package/dist/remote-logger.browser.js.map +1 -0
- package/dist/server/dual-server.d.ts +7 -4
- package/dist/server/dual-server.d.ts.map +1 -1
- package/dist/server/dual-server.js +124 -50
- package/dist/server/dual-server.js.map +1 -1
- package/dist/server/log-server.d.ts +12 -2
- package/dist/server/log-server.d.ts.map +1 -1
- package/dist/server/log-server.js +109 -63
- package/dist/server/log-server.js.map +1 -1
- package/dist/server/log-storage.d.ts +4 -0
- package/dist/server/log-storage.d.ts.map +1 -1
- package/dist/server/log-storage.js.map +1 -1
- package/dist/server/proxy.d.ts +39 -0
- package/dist/server/proxy.d.ts.map +1 -0
- package/dist/server/proxy.js +290 -0
- package/dist/server/proxy.js.map +1 -0
- package/dist/server/self-signed-cert.d.ts +9 -0
- package/dist/server/self-signed-cert.d.ts.map +1 -1
- package/dist/server/self-signed-cert.js +9 -0
- package/dist/server/self-signed-cert.js.map +1 -1
- package/dist/ui/ConsoleCaptureUI.d.ts.map +1 -1
- package/dist/ui/ConsoleCaptureUI.js +6 -1
- package/dist/ui/ConsoleCaptureUI.js.map +1 -1
- package/package.json +7 -2
- package/src/bundle/browser-entry.ts +157 -0
- package/src/client/RemoteLogClient.ts +22 -11
- package/src/client/types.ts +6 -0
- package/src/mcp/index.ts +42 -0
- package/src/mcp/mcp-server.ts +54 -8
- package/src/mcp/tools/index.ts +7 -0
- package/src/mcp/tools/logs-clear.ts +1 -1
- package/src/mcp/tools/logs-get-all.ts +1 -1
- package/src/mcp/tools/logs-get-errors.ts +1 -1
- package/src/mcp/tools/logs-get-file-path.ts +2 -2
- package/src/mcp/tools/logs-receive.ts +1 -1
- package/src/mcp/tools/logs-search.ts +1 -1
- package/src/mcp/tools/logs-status.ts +4 -1
- package/src/server/dual-server.ts +165 -57
- package/src/server/log-server.ts +126 -68
- package/src/server/log-storage.ts +4 -0
- package/src/server/proxy.ts +357 -0
- package/src/server/self-signed-cert.ts +9 -0
- package/src/ui/ConsoleCaptureUI.ts +6 -1
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* @module server/dual-server
|
|
7
7
|
*/
|
|
8
8
|
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
9
|
+
import * as http from "http";
|
|
10
|
+
import * as https from "https";
|
|
11
11
|
import { JsonlWriter } from "./jsonl-writer.js";
|
|
12
12
|
import { LogStorage } from "./log-storage.js";
|
|
13
13
|
/**
|
|
@@ -16,17 +16,18 @@ import { LogStorage } from "./log-storage.js";
|
|
|
16
16
|
* @param basePort - Starting port number
|
|
17
17
|
* @param host - Host to bind to
|
|
18
18
|
* @param quiet - Suppress output messages
|
|
19
|
+
* @param maxPort - Maximum port number to scan up to (default: 9099)
|
|
19
20
|
* @returns Promise resolving to available port number
|
|
20
21
|
* @throws Error if no available port found within MAX_PORT_SCAN_ATTEMPTS
|
|
21
22
|
*/
|
|
22
|
-
export declare function findAvailablePort(basePort: number, host: string, quiet?: boolean): Promise<number>;
|
|
23
|
+
export declare function findAvailablePort(basePort: number, host: string, quiet?: boolean, maxPort?: number): Promise<number>;
|
|
23
24
|
/**
|
|
24
25
|
* Options for creating a dual server.
|
|
25
26
|
*/
|
|
26
27
|
export interface DualServerOptions {
|
|
27
28
|
/** Port for HTTP server (default: 9080) */
|
|
28
29
|
httpPort?: number;
|
|
29
|
-
/** Host for HTTP server (default:
|
|
30
|
+
/** Host for HTTP server (default: 0.0.0.0) */
|
|
30
31
|
httpHost?: string;
|
|
31
32
|
/** Enable MCP server (default: true) */
|
|
32
33
|
mcpEnabled?: boolean;
|
|
@@ -46,6 +47,8 @@ export interface DualServerOptions {
|
|
|
46
47
|
jsonlWriter?: JsonlWriter;
|
|
47
48
|
/** Only serve /log POST and /health GET endpoints (default: false) */
|
|
48
49
|
logReceiveOnly?: boolean;
|
|
50
|
+
/** Maximum port number to scan up to (default: 9099) */
|
|
51
|
+
maxPortNumber?: number;
|
|
49
52
|
}
|
|
50
53
|
/**
|
|
51
54
|
* Result of creating a dual server.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dual-server.d.ts","sourceRoot":"","sources":["../../src/server/dual-server.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"dual-server.d.ts","sourceRoot":"","sources":["../../src/server/dual-server.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAmB,MAAM,kBAAkB,CAAC;AAsI/D;;;;;;;;;GASG;AACH,wBAAsB,iBAAiB,CACnC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,OAAe,EACtB,OAAO,GAAE,MAAwB,GAClC,OAAO,CAAC,MAAM,CAAC,CA0CjB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wCAAwC;IACxC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yCAAyC;IACzC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gDAAgD;IAChD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2FAA2F;IAC3F,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2FAA2F;IAC3F,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,iFAAiF;IACjF,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,sEAAsE;IACtE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,wDAAwD;IACxD,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,qDAAqD;IACrD,UAAU,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IACxC,0CAA0C;IAC1C,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,kCAAkC;IAClC,OAAO,EAAE,UAAU,CAAC;IACpB,4BAA4B;IAC5B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACjC;AAED;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAuKjG"}
|
|
@@ -6,13 +6,15 @@
|
|
|
6
6
|
* @module server/dual-server
|
|
7
7
|
*/
|
|
8
8
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
9
|
+
import { internalIpV4Sync } from "internal-ip";
|
|
9
10
|
import * as net from "net";
|
|
10
11
|
import * as os from "os";
|
|
11
12
|
import * as path from "path";
|
|
12
13
|
import { createMcpServer } from "../mcp/mcp-server.js";
|
|
13
14
|
import { JsonlWriter } from "./jsonl-writer.js";
|
|
14
|
-
import { createLogServer } from "./log-server.js";
|
|
15
|
+
import { createLogServer, setProxy } from "./log-server.js";
|
|
15
16
|
import { LogStorage } from "./log-storage.js";
|
|
17
|
+
import { createProxy } from "./proxy.js";
|
|
16
18
|
import { certFilesExist } from "./self-signed-cert.js";
|
|
17
19
|
// ANSI color codes for terminal output
|
|
18
20
|
const colors = {
|
|
@@ -26,6 +28,72 @@ const colors = {
|
|
|
26
28
|
const MAX_PORT_SCAN_ATTEMPTS = 100;
|
|
27
29
|
/** Maximum port number allowed (ports 9000-9099 per project guidelines) */
|
|
28
30
|
const MAX_PORT_NUMBER = 9099;
|
|
31
|
+
/** Maximum retries for binding after EADDRINUSE during listen */
|
|
32
|
+
const MAX_BIND_RETRIES = 10;
|
|
33
|
+
/**
|
|
34
|
+
* Attempt to bind an HTTP/HTTPS server to a port with retry on EADDRINUSE.
|
|
35
|
+
* This handles race conditions where a port becomes unavailable between
|
|
36
|
+
* port scanning and actual binding.
|
|
37
|
+
* @param serverFactory - Function to create a new server instance
|
|
38
|
+
* @param startPort - Starting port to try
|
|
39
|
+
* @param host - Host to bind to
|
|
40
|
+
* @param quiet - Suppress output messages
|
|
41
|
+
* @param maxPort - Maximum port number to scan up to (default: 9099)
|
|
42
|
+
* @returns Promise resolving to bound server and actual port
|
|
43
|
+
*/
|
|
44
|
+
async function tryBindWithRetry(serverFactory, startPort, host, quiet, maxPort = MAX_PORT_NUMBER) {
|
|
45
|
+
let port = startPort;
|
|
46
|
+
let attempts = 0;
|
|
47
|
+
while (attempts < MAX_BIND_RETRIES) {
|
|
48
|
+
if (port > maxPort) {
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
const server = serverFactory();
|
|
52
|
+
try {
|
|
53
|
+
await new Promise((resolve, reject) => {
|
|
54
|
+
const errorHandler = (err) => {
|
|
55
|
+
if (err.code === "EADDRINUSE") {
|
|
56
|
+
if (!quiet) {
|
|
57
|
+
// eslint-disable-next-line no-console
|
|
58
|
+
console.log(`${colors.yellow}Port ${port} claimed during bind, trying ${port + 1}...${colors.reset}`);
|
|
59
|
+
}
|
|
60
|
+
reject(err);
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
reject(err);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
server.once("error", errorHandler);
|
|
67
|
+
server.listen({ port, host, exclusive: false }, () => {
|
|
68
|
+
server.removeListener("error", errorHandler);
|
|
69
|
+
resolve();
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
// Success - server is bound
|
|
73
|
+
if (!quiet) {
|
|
74
|
+
// eslint-disable-next-line no-console
|
|
75
|
+
console.log(`${colors.green}HTTP server listening on ${host}:${port}${colors.reset}`);
|
|
76
|
+
}
|
|
77
|
+
return { server, port };
|
|
78
|
+
}
|
|
79
|
+
catch (err) {
|
|
80
|
+
if (err.code === "EADDRINUSE") {
|
|
81
|
+
port++;
|
|
82
|
+
attempts++;
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
// Re-throw non-EADDRINUSE errors
|
|
86
|
+
throw err;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
// Exhausted retries
|
|
90
|
+
const errorMsg = `Could not bind to any port after ${attempts} attempts. ` +
|
|
91
|
+
`Ports ${startPort}-${port - 1} are all in use or were claimed during bind.`;
|
|
92
|
+
if (!quiet) {
|
|
93
|
+
console.error(`${colors.red}${errorMsg}${colors.reset}`);
|
|
94
|
+
}
|
|
95
|
+
throw new Error(errorMsg);
|
|
96
|
+
}
|
|
29
97
|
/**
|
|
30
98
|
* Check if a port is available for binding.
|
|
31
99
|
* @param port - Port number to check
|
|
@@ -60,15 +128,16 @@ async function isPortAvailable(port, host) {
|
|
|
60
128
|
* @param basePort - Starting port number
|
|
61
129
|
* @param host - Host to bind to
|
|
62
130
|
* @param quiet - Suppress output messages
|
|
131
|
+
* @param maxPort - Maximum port number to scan up to (default: 9099)
|
|
63
132
|
* @returns Promise resolving to available port number
|
|
64
133
|
* @throws Error if no available port found within MAX_PORT_SCAN_ATTEMPTS
|
|
65
134
|
*/
|
|
66
|
-
export async function findAvailablePort(basePort, host, quiet = false) {
|
|
135
|
+
export async function findAvailablePort(basePort, host, quiet = false, maxPort = MAX_PORT_NUMBER) {
|
|
67
136
|
let port = basePort;
|
|
68
137
|
let attempts = 0;
|
|
69
138
|
while (attempts < MAX_PORT_SCAN_ATTEMPTS) {
|
|
70
|
-
if (port >
|
|
71
|
-
//
|
|
139
|
+
if (port > maxPort) {
|
|
140
|
+
// Stop if we exceed max port
|
|
72
141
|
break;
|
|
73
142
|
}
|
|
74
143
|
if (await isPortAvailable(port, host)) {
|
|
@@ -86,8 +155,8 @@ export async function findAvailablePort(basePort, host, quiet = false) {
|
|
|
86
155
|
attempts++;
|
|
87
156
|
}
|
|
88
157
|
// No available port found
|
|
89
|
-
const errorMsg = `Could not find available port after ${
|
|
90
|
-
`Ports ${basePort}-${port - 1} are all in use. ` +
|
|
158
|
+
const errorMsg = `Could not find available port after ${attempts} attempts starting from ${basePort}. ` +
|
|
159
|
+
`Ports ${basePort}-${Math.min(port - 1, maxPort)} are all in use. ` +
|
|
91
160
|
`Try killing existing processes: pkill -f "remote-log-server"`;
|
|
92
161
|
if (!quiet) {
|
|
93
162
|
console.error(`${colors.red}${errorMsg}${colors.reset}`);
|
|
@@ -103,7 +172,7 @@ export async function findAvailablePort(basePort, host, quiet = false) {
|
|
|
103
172
|
* @returns Promise resolving to the dual server result
|
|
104
173
|
*/
|
|
105
174
|
export async function createDualServer(options = {}) {
|
|
106
|
-
const { httpPort: requestedPort = 9080, httpHost = "
|
|
175
|
+
const { httpPort: requestedPort = 9080, httpHost = "0.0.0.0", mcpEnabled = true, httpEnabled = true, quiet = false, storage: externalStorage, jsonlWriter: externalJsonlWriter, logReceiveOnly = false, certPath, keyPath, maxPortNumber = MAX_PORT_NUMBER, } = options;
|
|
107
176
|
// Create or use provided JSONL writer
|
|
108
177
|
const jsonlBaseDir = path.join(os.tmpdir(), "remote-logger");
|
|
109
178
|
const jsonlWriter = externalJsonlWriter ?? new JsonlWriter(jsonlBaseDir);
|
|
@@ -112,22 +181,29 @@ export async function createDualServer(options = {}) {
|
|
|
112
181
|
let httpServer;
|
|
113
182
|
let mcpServer;
|
|
114
183
|
let actualHttpPort;
|
|
184
|
+
let proxyInstance;
|
|
115
185
|
// Track active connections for graceful shutdown
|
|
116
186
|
const activeConnections = new Set();
|
|
117
187
|
// Start HTTP server if enabled
|
|
118
188
|
if (httpEnabled) {
|
|
119
189
|
// Find an available port starting from the requested port
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
190
|
+
const startPort = await findAvailablePort(requestedPort, httpHost, quiet, maxPortNumber);
|
|
191
|
+
// Factory function to create server instances (for retry on bind failure)
|
|
192
|
+
const createServerInstance = () => {
|
|
193
|
+
return createLogServer({
|
|
194
|
+
port: startPort, // Port is set but not used until bind
|
|
195
|
+
host: httpHost,
|
|
196
|
+
storage,
|
|
197
|
+
quiet: true, // Quiet during factory, messages handled by tryBindWithRetry
|
|
198
|
+
logReceiveOnly,
|
|
199
|
+
certPath,
|
|
200
|
+
keyPath,
|
|
201
|
+
}).server;
|
|
202
|
+
};
|
|
203
|
+
// Bind with retry logic to handle race conditions
|
|
204
|
+
const bindResult = await tryBindWithRetry(createServerInstance, startPort, httpHost, quiet, maxPortNumber);
|
|
205
|
+
httpServer = bindResult.server;
|
|
206
|
+
actualHttpPort = bindResult.port;
|
|
131
207
|
// Track connections for graceful shutdown
|
|
132
208
|
httpServer.on("connection", (socket) => {
|
|
133
209
|
activeConnections.add(socket);
|
|
@@ -135,37 +211,8 @@ export async function createDualServer(options = {}) {
|
|
|
135
211
|
activeConnections.delete(socket);
|
|
136
212
|
});
|
|
137
213
|
});
|
|
138
|
-
|
|
139
|
-
httpServer.
|
|
140
|
-
httpServer.headersTimeout = 2000;
|
|
141
|
-
// Wait for HTTP server to be listening
|
|
142
|
-
const serverToStart = httpServer;
|
|
143
|
-
const portToUse = actualHttpPort;
|
|
144
|
-
await new Promise((resolve, reject) => {
|
|
145
|
-
serverToStart.on("error", (err) => {
|
|
146
|
-
// Provide helpful error message for port conflicts
|
|
147
|
-
if (err.code === "EADDRINUSE") {
|
|
148
|
-
const errorMsg = `Port ${portToUse} is already in use. ` +
|
|
149
|
-
`This shouldn't happen after port scanning - there may be a race condition. ` +
|
|
150
|
-
`Try again or kill existing processes: pkill -f "remote-log-server"`;
|
|
151
|
-
if (!quiet) {
|
|
152
|
-
console.error(`${colors.red}${errorMsg}${colors.reset}`);
|
|
153
|
-
}
|
|
154
|
-
reject(new Error(errorMsg));
|
|
155
|
-
}
|
|
156
|
-
else {
|
|
157
|
-
reject(err);
|
|
158
|
-
}
|
|
159
|
-
});
|
|
160
|
-
serverToStart.listen({ port: portToUse, host: httpHost, exclusive: false }, () => {
|
|
161
|
-
serverToStart.removeListener("error", reject);
|
|
162
|
-
if (!quiet) {
|
|
163
|
-
// eslint-disable-next-line no-console
|
|
164
|
-
console.log(`${colors.green}HTTP server listening on ${httpHost}:${portToUse}${colors.reset}`);
|
|
165
|
-
}
|
|
166
|
-
resolve();
|
|
167
|
-
});
|
|
168
|
-
});
|
|
214
|
+
httpServer.keepAliveTimeout = 30000;
|
|
215
|
+
httpServer.headersTimeout = 35000;
|
|
169
216
|
// Set server config in storage so MCP tools can report it
|
|
170
217
|
// Determine protocol based on whether valid cert files were provided
|
|
171
218
|
const useHttps = certPath && keyPath && certFilesExist(certPath, keyPath);
|
|
@@ -181,13 +228,36 @@ export async function createDualServer(options = {}) {
|
|
|
181
228
|
else {
|
|
182
229
|
mode = "dual";
|
|
183
230
|
}
|
|
231
|
+
// When bound to all interfaces (0.0.0.0), detect the machine's IP address
|
|
232
|
+
// for the endpoint URL since 0.0.0.0 is not a routable address for clients
|
|
233
|
+
let endpointHost = httpHost;
|
|
234
|
+
if (httpHost === "0.0.0.0") {
|
|
235
|
+
const internalIp = internalIpV4Sync();
|
|
236
|
+
if (internalIp) {
|
|
237
|
+
endpointHost = internalIp;
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
// Fallback for local-only use - don't use hostname as it may not resolve
|
|
241
|
+
endpointHost = "127.0.0.1";
|
|
242
|
+
if (!quiet) {
|
|
243
|
+
console.warn(`${colors.yellow}Could not detect LAN IP. Endpoint URL will only work locally.${colors.reset}`);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
const scriptUrl = `${protocol}://${endpointHost}:${actualHttpPort}/remote-logger.js`;
|
|
248
|
+
const proxyBaseUrl = `/proxy/`;
|
|
184
249
|
storage.setServerConfig({
|
|
185
250
|
httpPort: actualHttpPort,
|
|
186
251
|
httpHost,
|
|
187
252
|
protocol,
|
|
188
|
-
httpEndpoint: `${protocol}://${
|
|
253
|
+
httpEndpoint: `${protocol}://${endpointHost}:${actualHttpPort}/log`,
|
|
254
|
+
scriptUrl,
|
|
255
|
+
proxyBaseUrl: `${protocol}://${endpointHost}:${actualHttpPort}${proxyBaseUrl}`,
|
|
189
256
|
mode,
|
|
190
257
|
});
|
|
258
|
+
// Create and register the proxy instance
|
|
259
|
+
proxyInstance = createProxy(proxyBaseUrl, quiet);
|
|
260
|
+
setProxy(proxyInstance);
|
|
191
261
|
}
|
|
192
262
|
// Create and connect MCP server if enabled
|
|
193
263
|
if (mcpEnabled) {
|
|
@@ -210,6 +280,10 @@ export async function createDualServer(options = {}) {
|
|
|
210
280
|
httpServer.close(() => { resolve(); });
|
|
211
281
|
});
|
|
212
282
|
}
|
|
283
|
+
// Close proxy
|
|
284
|
+
if (proxyInstance) {
|
|
285
|
+
proxyInstance.close();
|
|
286
|
+
}
|
|
213
287
|
// Close JSONL writer only if we created it internally
|
|
214
288
|
if (ownsJsonlWriter) {
|
|
215
289
|
await jsonlWriter.close();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dual-server.js","sourceRoot":"","sources":["../../src/server/dual-server.ts"],"names":[],"mappings":"AAA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from "http";
|
|
|
16
16
|
import * as https from "https";
|
|
17
17
|
import { JsonlWriter } from "./jsonl-writer.js";
|
|
18
18
|
import { LogStorage } from "./log-storage.js";
|
|
19
|
+
import type { ProxyInstance } from "./proxy.js";
|
|
19
20
|
/**
|
|
20
21
|
* Get the shared LogStorage instance, creating it if needed.
|
|
21
22
|
* Creates a JsonlWriter for JSONL file streaming by default.
|
|
@@ -32,10 +33,19 @@ export declare function getJsonlWriter(): JsonlWriter | null;
|
|
|
32
33
|
* @param storage - The LogStorage instance to use
|
|
33
34
|
*/
|
|
34
35
|
export declare function setLogStorage(storage: LogStorage): void;
|
|
36
|
+
/**
|
|
37
|
+
* Set the shared proxy instance.
|
|
38
|
+
* @param proxy - The proxy instance to use
|
|
39
|
+
*/
|
|
40
|
+
export declare function setProxy(proxy: ProxyInstance): void;
|
|
41
|
+
/**
|
|
42
|
+
* Reset the browser bundle cache. Used for testing.
|
|
43
|
+
*/
|
|
44
|
+
export declare function resetBrowserBundleCache(): void;
|
|
35
45
|
export interface LogServerOptions {
|
|
36
46
|
/** Port to listen on (default: 9080) */
|
|
37
47
|
port?: number;
|
|
38
|
-
/** Hostname to bind to (default:
|
|
48
|
+
/** Hostname to bind to (default: 0.0.0.0) */
|
|
39
49
|
host?: string;
|
|
40
50
|
/** Path to SSL certificate file (HTTPS only used if both certPath and keyPath provided) */
|
|
41
51
|
certPath?: string;
|
|
@@ -100,7 +110,7 @@ export declare function startLogServer(options?: LogServerOptions): http.Server
|
|
|
100
110
|
/**
|
|
101
111
|
* Help text displayed when --help is passed.
|
|
102
112
|
*/
|
|
103
|
-
export declare const HELP_TEXT = "\nRemote Log Server - Remote logging for browser debugging\n\nUsage:\n npx remote-log-server [options]\n npx @graphty/remote-logger [options]\n\nOptions:\n --port, -p <port> Port to listen on (default: 9080)\n --host, -h <host> Hostname to bind to (default:
|
|
113
|
+
export declare const HELP_TEXT = "\nRemote Log Server - Remote logging for browser debugging\n\nUsage:\n npx remote-log-server [options]\n npx @graphty/remote-logger [options]\n\nOptions:\n --port, -p <port> Port to listen on (default: 9080)\n --host, -h <host> Hostname to bind to (default: 0.0.0.0)\n --cert, -c <path> Path to SSL certificate file (enables HTTPS)\n --key, -k <path> Path to SSL private key file (enables HTTPS)\n --log-file, -l <path> Write logs to file\n --mcp-only Start only MCP server (no HTTP)\n --http-only Start only HTTP server (legacy mode)\n --mcp Alias for --mcp-only (deprecated)\n --quiet, -q Suppress startup banner\n --help Show this help message\n\nProtocol:\n HTTP is used by default. To use HTTPS, provide both --cert and --key.\n\nModes:\n Default (no flags) Dual mode: HTTP + MCP running together\n --mcp-only MCP only: For Claude Code integration\n --http-only HTTP only: Legacy mode for browser debugging\n\nExamples:\n npx remote-log-server # Start dual mode (HTTP + MCP)\n npx remote-log-server --port 9085 # Custom port\n npx remote-log-server --mcp-only # MCP server only (for Claude Code)\n npx remote-log-server --http-only # HTTP server only (legacy)\n npx remote-log-server --cert cert.crt --key key.key # Use HTTPS with custom certs\n npx remote-log-server --log-file ./tmp/logs.jsonl # Also write to file\n";
|
|
104
114
|
/**
|
|
105
115
|
* Result of parsing command line arguments.
|
|
106
116
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-server.d.ts","sourceRoot":"","sources":["../../src/server/log-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAiB,UAAU,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"log-server.d.ts","sourceRoot":"","sources":["../../src/server/log-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO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