|
|
@ -38,17 +38,21 @@ export const proxyServerVnc = createProxyMiddleware({ |
|
|
|
error: (error, request, response) => { |
|
|
|
error: (error, request, response) => { |
|
|
|
perr(`VNC proxy error: ${error}`); |
|
|
|
perr(`VNC proxy error: ${error}`); |
|
|
|
|
|
|
|
|
|
|
|
let resType: string; |
|
|
|
if (!response) { |
|
|
|
|
|
|
|
perr(`Missing response; got [${response}]`); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if ('writeHead' in response) { |
|
|
|
if ('writeHead' in response) { |
|
|
|
resType = 'ServerResponse'; |
|
|
|
pout('Got ServerResponse object'); |
|
|
|
|
|
|
|
|
|
|
|
response.writeHead(500).end(); |
|
|
|
return response.writeHead(500).end(); |
|
|
|
} else { |
|
|
|
|
|
|
|
resType = 'Socket'; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pout(`Response type = ${resType}`); |
|
|
|
pout(`Got Socket object`); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
response.end(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
ws: true, |
|
|
|
ws: true, |
|
|
|