mirror of
https://github.com/pockethost/pockethost.git
synced 2025-05-28 09:46:46 +00:00
Support web socket forwarding in proxy
This commit is contained in:
parent
3168a2f8dc
commit
99867ea518
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user