Closed allmors closed 8 months ago
import { createServer } from "node:http"; import { createProxyServer } from "httpxy"; const proxy = createProxyServer({}); const server = createServer(async (req, res) => { try { await proxy.web(req, res, { target: main.url, }); } catch (error) { console.error(error); res.statusCode = 500; res.end("Proxy error: " + error.toString()); } }); server.listen(3000, () => { console.log("Proxy is listening on http://localhost:3000"); });
The above code runs with an error
No response
Describe the change
The above code runs with an error
URLs
No response
Additional information