(res: ServerResponse, options: Required<DaemonProxyOptions>)
| 80 | } |
| 81 | |
| 82 | async function sendProxyHealth(res: ServerResponse, options: Required<DaemonProxyOptions>) { |
| 83 | const upstream = await readUpstreamHealth(options); |
| 84 | res.statusCode = 200; |
| 85 | res.setHeader('content-type', 'application/json'); |
| 86 | res.end(JSON.stringify(buildDaemonHealthPayload('agent-device-proxy', { upstream }))); |
| 87 | } |
| 88 | |
| 89 | async function readUpstreamHealth(options: Required<DaemonProxyOptions>): Promise<unknown> { |
| 90 | const upstreamUrl = new URL(buildDaemonHttpUrl(options.upstreamBaseUrl, 'health')); |
no test coverage detected