1
0
mirror of https://github.com/zumbiepig/MineXLauncher.git synced 2025-06-07 19:34:49 +00:00
MineXLauncher/proxy.ts
zumbiepig bf252d7707
.
2024-09-24 14:24:58 -07:00

24 lines
478 B
TypeScript

import express from 'express';
import morgan from 'morgan';
import httpProxy from 'http-proxy';
const PORT = process.env['PORT'] ?? 3000;
const proxy = httpProxy.createProxyServer({
target: 'https://launcher.orionzleon.me',
ws: true,
xfwd: true,
secure: true,
changeOrigin: true,
});
const app = express();
app.use(morgan('combined'));
app.use((req, res) => proxy.web(req, res));
app.listen(PORT, () =>
console.log(`Server running on http://localhost:${PORT}/`),
);