diff --git a/src/server/http.js b/src/server/http.js index 6f4c4e1..0a7ad0d 100644 --- a/src/server/http.js +++ b/src/server/http.js @@ -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());