The best way to control Claude Code, Codex and more from any computer or phone

main
ts 11 lines 546 Bytes
Raw
1 import type * as Http from "node:http"
2 import type * as Https from "node:https"
3 import { createRequire } from "node:module"
4
5 // Importing node:http as ESM evaluates its lazy WebSocket exports, which loads
6 // undici. Load the CommonJS modules instead. `__filename` covers bundlers that
7 // emit CommonJS, where `import.meta.url` is undefined.
8 const require = createRequire(typeof __filename === "string" ? __filename : import.meta.url)
9
10 export const http: typeof Http = require("node:http")
11 export const https: typeof Https = require("node:https")