Support web socket forwarding in proxy

This commit is contained in:
Ben Allfree 2023-12-28 06:52:16 -08:00
parent 3168a2f8dc
commit 99867ea518

View File

@ -4,7 +4,7 @@ import vhost from 'vhost'
export function createVhostProxyMiddleware(host: string, target: string) {
console.log(`Creating ${host}->${target}`)
const handler = createProxyMiddleware({ target })
const handler = createProxyMiddleware({ target, ws: true })
return vhost(host, (_req, res, next) => {
const req = _req as unknown as Request
const method = req.method