This commit is contained in:
cha0s 2020-07-12 19:04:41 -05:00
parent 0bb90808f4
commit 6f53f55208

View File

@ -23,13 +23,9 @@ export function createHttpServer() {
target: 'http://127.0.0.1:31345',
});
proxy.on('error', (err, req, res) => {
if (!(res instanceof ServerResponse)) {
return;
if (res instanceof ServerResponse) {
res.status(502).end('Bad Gateway (WDS)');
}
res.writeHead(500, {
'Content-Type': 'text/plain',
});
res.end('Bad Proxy');
});
app.get('*', (req, res) => proxy.web(req, res));
httpServer.on('close', () => proxy.close());